Skip to content
Snippets Groups Projects
Commit b659a9ee authored by Tom Prince's avatar Tom Prince
Browse files

Add black and isort linting.

parent 2615f1f0
No related branches found
No related tags found
1 merge request!242Run black and isort over the codebase.
......@@ -27,3 +27,15 @@
directory = "misc"
name = "Misc"
showcontent = false
[tool.black]
target-version = ['py27']
extend-exclude = '''
# A regex preceded with ^/ will apply only to files and directories
# in the root of the project.
^/src/_zkapauthorizer/_version.py
'''
[tool.isort]
profile = "black"
skip = ["src/_zkapauthorizer/_version.py"]
......@@ -32,6 +32,14 @@ in
packagesExtra = [ zkapauthorizer ];
_.hypothesis.postUnpack = "";
};
lint-python = mach-nix.mkPython {
python = "python39";
requirements = ''
isort
black
'';
};
in
pkgs.runCommand "zkapauthorizer-tests" {
passthru = {
......@@ -42,6 +50,8 @@ in
pushd ${zkapauthorizer.src}
${python}/bin/pyflakes
${lint-python}/bin/black --check src
${lint-python}/bin/isort --check src
popd
ZKAPAUTHORIZER_HYPOTHESIS_PROFILE=${hypothesisProfile'} ${python}/bin/python -m ${if collectCoverage
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment