Skip to content

Commit

Permalink
the outer pre-commit config and pyproject should be as simple as poss…
Browse files Browse the repository at this point in the history
…ible, while the inner one should retain all the complexity
  • Loading branch information
harrisonpim committed Dec 14, 2023
1 parent 872c93a commit dd9c45a
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 87 deletions.
17 changes: 0 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,6 @@ repos:
- id: check-json
- id: detect-aws-credentials
args: [ --allow-missing-credentials ]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
hooks:
- id: ruff
types_or: [ python ]
args: [ --fix ]
- id: ruff-format
types_or: [ python, jupyter ]
- repo: local
hooks:
- id: pyright
name: pyright
entry: pyright
language: node
files: ^src/
types: [python]
additional_dependencies: ['[email protected]']
- repo: https://github.com/python-poetry/poetry
rev: '1.7.0'
hooks:
Expand Down
44 changes: 22 additions & 22 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 0 additions & 42 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,11 @@ version = "0.1.0"
description = ""
authors = ["CPR tech <[email protected]>"]
readme = "README.md"
packages = [{include = "experiment_template"}]

[tool.poetry.dependencies]
python = "^3.9"
pre-commit = "^3.0.4"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.pytest.ini_options]
addopts = "-p no:cacheprovider"
env_files = """
.env.test
.env
"""
markers = [
"search",
"unit",
]

[tool.black]
line-length = 88
target-version = ["py39"]

[tool.ruff]
select = ["E", "F", "D"]
extend-select = ["I"]
# Docstring Ignores:
# D100 - Missing docstring in public module
# D103 - Missing docstring in public function
# D104 - Missing docstring in public package
# D107 - Missing docstring in __init__
# D202 - No blank lines allowed after function docstring
# D203 - 1 blank line required before class docstring
# D213 - Multi-line docstring summary should start at the first line
# D400 - First line should end with a period
# D401 - First line should be in imperative mood
# D406 - Section name should end with a newline
# D407 - Missing dashed underline after section
# D413 - Missing blank line after last section
# D415 - First line should end with a period, question mark, or exclamation point
ignore = ["D100", "D103", "D104", "D107", "D202", "D203", "D212", "D400", "D401", "D406", "D407", "D413", "D415", "E501"]
line-length = 88

# Ignore `E402` (import violations) in all `__init__.py` files, and in `path/to/file.py`.
[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"]
"tests/*" = ["E501"]
13 changes: 8 additions & 5 deletions {{ cookiecutter.repo_name }}/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ repos:
- id: check-json
- id: detect-aws-credentials
args: [ --allow-missing-credentials ]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.1.5'
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format
- id: ruff
types_or: [ python ]
args: [ --fix ]
- id: ruff-format
types_or: [ python, jupyter ]
- repo: local
hooks:
- id: pyright
Expand All @@ -24,3 +26,4 @@ repos:
rev: '1.7.0'
hooks:
- id: poetry-lock
args: ["--no-update"]
2 changes: 1 addition & 1 deletion {{ cookiecutter.repo_name }}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ line-length = 88
target-version = ["py39"]

[tool.ruff]
select = ["E", "F", "D"]
select = ["E", "F", "D", "I"]
# Docstring Ignores:
# D100 - Missing docstring in public module
# D103 - Missing docstring in public function
Expand Down

0 comments on commit dd9c45a

Please sign in to comment.