Skip to content

Commit

Permalink
feat: ruff.toml added as parallel to .pylintrc
Browse files Browse the repository at this point in the history
  • Loading branch information
Schischke, David committed Nov 7, 2023
1 parent fa474c9 commit b753ee1
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 7 deletions.
2 changes: 2 additions & 0 deletions {{cookiecutter.repo_name}}/.temp_ci_cd/.manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ features:
- .pylintrc
- name: ruff
enabled: {{cookiecutter.linter_name == "ruff"}}
resources:
- ruff.toml
2 changes: 1 addition & 1 deletion {{cookiecutter.repo_name}}/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ dependencies:
- black=23.1.0
- python=3.10.9
- pre-commit=3.0.4
- nbqa=1.6.1
{%- if cookiecutter.install_jupyter == 'yes' %}
- jupyter=1.0.0
- nbqa=1.6.1
{%- endif %}
{%- if cookiecutter.linter_name == "pylint" %}
- pylint=2.16.1
Expand Down
6 changes: 0 additions & 6 deletions {{cookiecutter.repo_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,4 @@ exclude = '''
[tool.isort]
profile = 'black'
line_length = 100

{% elif cookiecutter.linter_name == "ruff" %}
[tool.ruff]
# Never enforce `E501` (line length violations), as this is handled by black
ignore = ["E501"]
line-length = 100 # sync with black
{% endif %}
33 changes: 33 additions & 0 deletions {{cookiecutter.repo_name}}/ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# sync with black
line-length = 100

# No need for NBQA as ruff has native Jupyter support
extend-include = ["*.ipynb"]

# https://docs.astral.sh/ruff/rules/
ignore = [
# "E501", # Line too long, handled by black
# "W291", # Trailing whitespace, handled by black
# "W292", # Missing final newline, handled by black
# "PLR0904", # Too many public methods
# "PLR0911", # Too many return statements
# "PLR0913", # Too many arguments
# "PLC0415", # Import outside toplevel
# NA as checks yet but mentioned in github comments
# "C0305", # Trailing newlines, handled by black
# "C0114", # Missing module docstring
# "C0115", # Missing class docstring
# "C0116", # Missing function docstring
# "R0902", # Too many instance attributes
# "R0903", # Too few public methods
# "R0914", # Too many locals
# "W0124", # Confusing with statement
# "C0413", # Wrong import position
# "C0410", # Multiple imports
# "R1705", # No else return
# "W0201", # Attribute defined outside init
# "E1123", # Unexpected keyword arg
# "C0401", # Wrong spelling in comment
# "C0402", # Wrong spelling in docstring
# "C0403" # Invalid character in docstring
]

0 comments on commit b753ee1

Please sign in to comment.