mirror of https://github.com/zulip/zulip.git
lint: Run isort as a linter.
With a change to increase the line length to 100 characters by tabbott. Fixes #2665. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
365fe0b3d5
commit
48e55875fe
|
@ -3,4 +3,4 @@ multi_line_output = 3
|
|||
known_third_party = netifaces
|
||||
include_trailing_comma = True
|
||||
use_parentheses = True
|
||||
line_length = 88
|
||||
line_length = 100
|
||||
|
|
|
@ -89,6 +89,9 @@ def run() -> None:
|
|||
linter_config.external_linter('gitlint', ['tools/commit-message-lint'],
|
||||
description="Checks commit messages for common formatting errors."
|
||||
"(config: .gitlint)")
|
||||
linter_config.external_linter('isort', ['tools/run-isort'], ['py'],
|
||||
description="Sorts Python import statements",
|
||||
fix_arg='--fix')
|
||||
|
||||
semgrep_command = ["semgrep", "--config=./tools/semgrep.yml", "--error",
|
||||
# This option is dangerous in the context of running
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
set -eu
|
||||
if [ "$1" = "--fix" ]; then
|
||||
shift
|
||||
exec isort "$@"
|
||||
else
|
||||
exec isort --check-only --diff "$@"
|
||||
fi
|
Loading…
Reference in New Issue