Skip to content

Commit

Permalink
Use ruff over black in the root (#112)
Browse files Browse the repository at this point in the history
* Implement ruff over black

* Handle Bandit issues in pre-commit
  • Loading branch information
mikeweltevrede authored Jul 2, 2024
1 parent f448c9c commit 5d33920
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: "22.8.0"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.6"
hooks:
- id: black
- id: ruff
args: [--exit-non-zero-on-fix, --config=pyproject.toml]
exclude: ^{{cookiecutter.project_name}}
- id: ruff-format
args: [--config=pyproject.toml]
exclude: ^{{cookiecutter.project_name}}

- repo: https://github.com/pre-commit/mirrors-prettier
Expand Down
2 changes: 1 addition & 1 deletion cookiecutter_poetry/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
def main() -> None:
cwd = os.path.dirname(__file__)
package_dir = os.path.abspath(os.path.join(cwd, ".."))
os.system(f"cookiecutter {package_dir}")
os.system(f"cookiecutter {package_dir}") # noqa: S605 | No injection, retrieving path in OS
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ ignore = [
]

[tool.ruff.per-file-ignores]
"tests/*" = ["S101"]
"tests/*" = ["S101", "S603"]

0 comments on commit 5d33920

Please sign in to comment.