Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add the 'I' selector to ruff config to sort imports #13

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,8 @@ 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
- repo: https://github.com/python-poetry/poetry
rev: '1.7.0'
hooks:
- id: ruff
types_or: [ python, jupyter ]
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]']
- id: poetry-lock
args: ["--no-update"]
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.

41 changes: 0 additions & 41 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +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"]
# 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
Loading