diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..b04addfbb6 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,26 @@ +repos: + - repo: local + hooks: + - id: mojo-format + name: mojo-format + entry: mojo format mojo + language: system + files: '\.(mojo|🔥|py)$' + stages: [commit] + - id: check-docstrings + name: check-docstrings + entry: python3 ./mojo/stdlib/scripts/check-docstrings.py + language: system + pass_filenames: false + stages: [commit] + - id: check-license + name: check-license + entry: mojo mojo/stdlib/scripts/check_licenses.mojo + language: system + files: '\.(mojo|🔥|py)$' + stages: [commit] + - repo: https://github.com/igorshubovych/markdownlint-cli + rev: v0.40.0 + hooks: + - id: markdownlint + args: ['--config', 'mojo/stdlib/scripts/.markdownlint.yaml', '--fix'] diff --git a/mojo/stdlib/scripts/check-docstrings.py b/mojo/stdlib/scripts/check-docstrings.py index ddba7bb42c..1eb77ea27e 100644 --- a/mojo/stdlib/scripts/check-docstrings.py +++ b/mojo/stdlib/scripts/check-docstrings.py @@ -27,7 +27,7 @@ def main(): "--diagnose-missing-doc-strings", "-o", "/dev/null", - "./stdlib/src", + "./mojo/stdlib/src", ] result = subprocess.run(command, capture_output=True) if result.stderr or result.returncode != 0: