No bug: Make isort exit with failure in CI; r=Callek
authorTom Prince <mozilla@hocat.ca>
Wed, 13 May 2020 20:00:53 +0000
changeset 224 6332add3e98337e3ed143d1450728e6f4d2065a0
parent 223 b40ff4fa9e5a2ce4a1ac327d723c038b917f2ff0
child 225 8ea129f9aeed7aaa28312a3d2e984a426c4c183c
push id162
push usermozilla@hocat.ca
push dateWed, 13 May 2020 20:12:16 +0000
treeherderci-admin@6332add3e983 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersCallek
No bug: Make isort exit with failure in CI; r=Callek Running isort with `--diff` but not `--check` would succeed even if there were diffrences. Differential Revision: https://phabricator.services.mozilla.com/D75177
src/fxci/workers.py
src/tcadmin/diff.py
taskcluster/ci/tests/kind.yml
--- a/src/fxci/workers.py
+++ b/src/fxci/workers.py
@@ -1,11 +1,12 @@
+import json
 import sys
+
 import yaml
-import json
 from taskcluster import WorkerManager, optionsFromEnvironment
 
 
 def show_json(workers):
     print(json.dumps(workers, sort_keys=True, indent=2, separators=(",", ": ")))
 
 
 def show_yaml(workers):
--- a/src/tcadmin/diff.py
+++ b/src/tcadmin/diff.py
@@ -3,18 +3,18 @@
 # This Source Code Form is subject to the terms of the Mozilla Public License,
 # v. 2.0. If a copy of the MPL was not distributed with this file, You can
 # obtain one at http://mozilla.org/MPL/2.0/.
 
 import difflib
 import re
 import subprocess
 import tempfile
+from functools import partial
 from unittest import mock
-from functools import partial
 
 import attr
 import blessings
 import click
 
 from .options import diff_options, with_options
 from .resources import Resources
 from .util.ansi import strip_ansi
--- a/taskcluster/ci/tests/kind.yml
+++ b/taskcluster/ci/tests/kind.yml
@@ -96,17 +96,17 @@ jobs:
 
     isort:
         description: "Run `isort` to validate the latest changes"
         treeherder:
             symbol: isort
         run:
             command: >-
                 pip install --user -r requirements/test.txt  &&
-                cd src && isort --diff --recursive .
+                cd src && isort --check --diff --recursive .
 
     yamllint:
         description: "Run `yamllint` to validate the latest changes"
         treeherder:
             symbol: yaml
         run:
             command: >-
                 pip install --user -r requirements/test.txt  &&