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

Devops 1440 update ruff 0.4.4 #198

Merged
merged 3 commits into from
May 22, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
python-version: '3.9'

- name: Install ruff
run: pip install ruff
run: pip install ruff==0.4.4

- name: Run ruff format checker
run: ruff format --check --config pyproject.toml
Expand Down
10 changes: 7 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ repos:


- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.1
rev: v0.4.4
hooks:

# These will fail the linting GitHub action if the files are not formatted correctly
- id: ruff-format
args:
- '--config=pyproject.toml'
- '--check'
- id: ruff
args:
- '--config=pyproject.toml'
- '--config=pyproject.toml'
# This will actually modify the files prior to checkin
- id: ruff-format
args:
- '--config=pyproject.toml'
62 changes: 21 additions & 41 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,40 +1,23 @@
[tool.black]
# don't format the installed clients or the SDK-generated files.
extend-exclude = '''
import_specifications/clients/authclient.py
'''
line-length = 100




[tool.ruff]
lint.select = [
# core
"F", # Pyflakes
"E", # pycodestyle errors
"W", # pycodestyle warnings
# "C90", # mccabe + #TODO disable complexity checks
# "I", # isort #TODO enable sort of imports
# "N", # pep8-naming #Todo enable proper naming
# "D", # pydocstyle - disabled for now
# "UP", # pyupgrade # TODO Enable Type Annotations
[tool.ruff.lint]
# Selected linting rules
select = [
"F", # Pyflakes
"E", # pycodestyle errors
"W", # pycodestyle warnings
# "C90", # mccabe (complexity checks disabled)
# "I", # isort (sort of imports disabled)
# "N", # pep8-naming (proper naming disabled)
# "D", # pydocstyle (now moved to lint.pydocstyle)
# "UP", # pyupgrade (Type Annotations disabled)
]

# E203: whitespace before ‘,’, ‘;’, or ‘:’
# E501: line length
# W503: line break after binary operator
lint.ignore = [
"E203",
"E501",
"S101",
ignore = [
"E203", # whitespace before ‘,’, ‘;’, or ‘:’
"E501", # line length
"S101", # use of assert detected
]

# Allow autofix for all enabled rules (when `--fix`) is provided.
lint.fixable = ["ALL"]
lint.unfixable = []

# Exclude a variety of commonly ignored directories.
fixable = ["ALL"]
unfixable = []
per-file-ignores = {}
exclude = [
"__pypackages__",
"_build",
Expand Down Expand Up @@ -65,14 +48,11 @@ exclude = [
"venv",
"import_specifications/clients/authclient.py",
"import_specifications/clients/baseclient.py",
]
lint.per-file-ignores = { }

# Same as Black.
]
[tool.ruff]
line-length = 100

# Assume Python 3.12.
target-version = "py312"

[tool.ruff.pydocstyle]
[tool.ruff.lint.pydocstyle]
convention = "google"
Loading