-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
739567e
commit 9b2cfc8
Showing
5 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Lua pre-commit config | ||
|
||
In a repository that requires [pre-commit](https://pre-commit.com), simply add a | ||
file called `.pre-commit-config.yaml` with the following code. | ||
|
||
```yaml | ||
repos: | ||
- repo: https://github.com/paddyroddy/.github | ||
rev: v0.1.0 | ||
hooks: | ||
- id: lua-hooks | ||
``` | ||
Then run `pre-commit install; pre-commit autoupdate`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# noqa: D104 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
repos: | ||
- repo: https://github.com/adamchainz/blacken-docs | ||
rev: 1.18.0 | ||
hooks: | ||
- id: blacken-docs | ||
additional_dependencies: | ||
- black | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.6.3 | ||
hooks: | ||
- id: ruff | ||
- id: ruff-format | ||
- repo: https://github.com/mgedmin/check-manifest | ||
rev: "0.49" | ||
hooks: | ||
- id: check-manifest | ||
additional_dependencies: | ||
- setuptools-scm | ||
args: | ||
- --no-build-isolation | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.11.2 | ||
hooks: | ||
- id: mypy | ||
additional_dependencies: | ||
- numpy | ||
- pydantic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env python | ||
"""Lua pre-commit hooks.""" | ||
|
||
import pathlib | ||
import sys | ||
|
||
HERE = pathlib.Path(__file__).resolve() | ||
|
||
sys.path.append(str(HERE.parents[1])) | ||
|
||
from _run_hooks import run_hooks # noqa: E402 | ||
|
||
|
||
def main() -> int: | ||
""" | ||
Run the Lua pre-commit hooks. | ||
Returns | ||
The return code of the process | ||
""" | ||
return run_hooks(pathlib.Path("lua/lua-hooks.yaml")) | ||
|
||
|
||
if __name__ == "__main__": | ||
sys.exit(main()) |