Esempio n. 1
0
def _check_code_style_with_flake8():
    cowsay("Flake8 Style Guide Enforcement")
    flake8_return_code = git.hook(strict=git.config_for("strict"), lazy=git.config_for("lazy"))
    if flake8_return_code == 0:
        print("Flake8 Exit Status: 0 => OK!")
        print("")
    else:
        print("")
        print(f"Flake8 Exit Status: {flake8_return_code} => aborting commit!")
        print("")
        sys.exit(flake8_return_code)
Esempio n. 2
0
#!/usr/bin/env python
"""Pre-commit hook to check code with flake8."""
import sys

from flake8.main import git

if __name__ == "__main__":
    sys.exit(
        git.hook(strict=git.config_for("strict"), lazy=git.config_for("lazy")))
Esempio n. 3
0
#!/usr/bin/env python

import sys

from flake8.main import git

if __name__ == "__main__":
    sys.exit(git.hook(strict=True, lazy=git.config_for("lazy")))
Esempio n. 4
0
import sys

from flake8.main import git

if __name__ == '__main__':
    sys.exit(
        git.hook(
            strict=git.config_for('strict'),
            lazy=git.config_for('lazy'),
        ))
Esempio n. 5
0
#!/usr/bin/env python

import sys

from flake8.main import git

if __name__ == '__main__':
    sys.exit(git.hook(
        strict=True,
        lazy=git.config_for('lazy'),
    ))