Exemplo n.º 1
0
def init(precommit):
    precommit.check(checks.NoStagedAndUnstagedChanges())
    precommit.check(checks.NoWhitespaceInFilePath())
    precommit.check(checks.DoNotSubmit())

    # Check Python format with black.
    precommit.check(checks.PythonFormat())

    # Lint Python code with flake8.
    precommit.check(checks.PythonLint())

    # Check the order of Python imports with isort.
    precommit.check(checks.PythonImportOrder())

    # Check that requirements.txt matches pip freeze.
    precommit.check(checks.PipFreeze(venv=".venv"))

    # Check Python static type annotations with mypy.
    # precommit.check(checks.PythonTypes())

    # Lint JavaScript code with ESLint.
    precommit.check(
        checks.JavaScriptLint(
            include=["*.ts"],
            exclude=["webpack.config.js"],
        ))
    precommit.check(checks.JavaScriptPrettierFormat(include=["*.ts"]))

    # Check Rust format with rustfmt.
    precommit.check(checks.RustFormat())
Exemplo n.º 2
0
def init(precommit):
    precommit.check(checks.NoStagedAndUnstagedChanges())
    precommit.check(checks.NoWhitespaceInFilePath())
    precommit.check(checks.DoNotSubmit())

    # Check Python format with black.
    precommit.check(checks.PythonFormat())

    # Lint Python code with flake8.
    precommit.check(checks.PythonLint())

    # Check the order of Python imports with isort.
    precommit.check(checks.PythonImportOrder())

    # Check that requirements.txt matches pip freeze.
    precommit.check(checks.PipFreeze(venv=".venv"))

    # Check Python static type annotations with mypy.
    # precommit.check(checks.PythonTypes())

    # Lint JavaScript code with ESLint.
    precommit.check(checks.JavaScriptLint())

    # Check Rust format with rustfmt.
    precommit.check(checks.RustFormat())

    # Run the test suite.
    precommit.check(checks.Command("UnitTests", ["./do", "test"]))
Exemplo n.º 3
0
def init(precommit):
    precommit.check(checks.NoStagedAndUnstagedChanges())
    precommit.check(checks.NoWhitespaceInFilePath())
    precommit.check(checks.DoNotSubmit())

    precommit.check(
        checks.Command("E2ETests", ["./t"],
                       slow=True,
                       exclude=["*.md", "precommit.py"]))
    precommit.check(checks.RustFormat())

    # Check Python format with black.
    precommit.check(checks.PythonFormat())

    # Lint Python code with flake8.
    precommit.check(checks.PythonLint())

    # Check the order of Python imports with isort.
    precommit.check(checks.PythonImportOrder())

    # Check Python static type annotations with mypy.
    # precommit.check(checks.PythonTypes())

    # Lint JavaScript code with ESLint.
    precommit.check(checks.JavaScriptLint())
Exemplo n.º 4
0
def init(precommit):
    precommit.check(checks.NoStagedAndUnstagedChanges())
    precommit.check(checks.NoWhitespaceInFilePath())
    precommit.check(checks.DoNotSubmit())

    pyinclude = ["test"]

    # Check Python format with black.
    precommit.check(checks.PythonFormat(include=pyinclude))

    # Lint Python code with flake8.
    precommit.check(checks.PythonLint(include=pyinclude))

    # Check the order of Python imports with isort.
    precommit.check(checks.PythonImportOrder(include=pyinclude))

    # Check that requirements.txt matches pip freeze.
    precommit.check(checks.PipFreeze(venv=".venv"))

    # Check Python static type annotations with mypy.
    # precommit.check(checks.PythonTypes())

    # Lint JavaScript code with ESLint.
    precommit.check(checks.JavaScriptLint())

    # Check Rust format with rustfmt.
    precommit.check(checks.RustFormat())

    # Run a custom command.
    # precommit.check(checks.Command("UnitTests", ["./test"]))

    # Run a custom command on each file.
    # precommit.check(checks.Command("FileCheck", ["check_file"], pass_files=True))

    precommit.check(checks.Command("UnitTests", ["./test"]))
Exemplo n.º 5
0
def init(precommit):
    precommit.check(checks.NoStagedAndUnstagedChanges())
    precommit.check(checks.NoWhitespaceInFilePath())
    precommit.check(checks.DoNotSubmit())

    # Check Python format with black.
    precommit.check(checks.PythonFormat())

    # Lint Python code with flake8.
    precommit.check(checks.PythonLint())

    # Check the order of Python imports with isort.
    precommit.check(checks.PythonImportOrder())

    # Check that requirements.txt matches pip freeze.
    precommit.check(checks.PipFreeze(venv=".venv"))

    # Run unit tests.
    precommit.check(checks.Command("UnitTests", ["./do", "test"], exclude=["*.md"]))