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())
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"]))
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())
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"]))
def init(precommit): # Generic checks precommit.check(checks.NoStagedAndUnstagedChanges()) precommit.check(checks.NoWhitespaceInFilePath()) precommit.check(checks.DoNotSubmit()) # Language-specific checks precommit.check(checks.PythonFormat()) precommit.check(checks.PythonLint(args=["--extend-ignore=E731"])) precommit.check(checks.PythonTypes(exclude=["precommit.py"])) precommit.check(checks.Command("UnitTests", ["python3", "oeuvre_test.py"]))
def init(precommit): # Generic checks precommit.check(checks.NoStagedAndUnstagedChanges()) precommit.check(checks.NoWhitespaceInFilePath()) precommit.check(checks.DoNotSubmit()) # Language-specific checks precommit.check(checks.PythonFormat()) precommit.check(checks.PythonStyle()) precommit.check( checks.Command(["mypy", "--ignore-missing-imports"], per_file=True), pattern=r".*\.py", )
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"]))