Skip to content

Commit

Permalink
WIP ruff linter in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
noliveleger committed Aug 27, 2024
1 parent d37e45e commit 50b53fe
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ jobs:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
args: 'check --preview'
changed-files: 'true'
26 changes: 21 additions & 5 deletions kpi/deployment_backends/ruff_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
from kpi import deployment_backends
from django.utils import timezone
import re
from django.utils.timezone import now
import rest_framework


class MyClass:
def __init__(self):
pass



def __str__(self):
pass


def test_conf():
if timezone.now().date() == timezone.now().date():
re.compile('foo', re.IGNORECASE)
foo = "allo"
my_str = f"ceci est un message avec un ' {foo} parce que sinon ça chie!"
print(my_str)


def mon_autre():
my_class = MyClass()
print(str(my_class)) # noqa
16 changes: 13 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,28 @@
# verbose = true
line-length = 80
skip-string-normalization = true

[tool.isort]
profile = "black"
known_first_party = "kobo"
no_lines_before = ["LOCALFOLDER"]

[tool.ruff]
line-length = 80
line-length = 88
[tool.ruff.format]
quote-style = "single" # Preserve is coming soon to ruff
[tool.ruff.lint]
# Enable ruff isort
extend-select = ["I"]
extend-select = [
"I", # Enable ruff isort
"Q", # Flake quotes
"E", # pycodestyle, some needs `--preview` to be enable
"N", # PEP-8 naming convention
"W1", # Indentation warning
"W292", # no newline at end of file
"T20", # (p)print found
]
[tool.ruff.lint.flake8-quotes]
inline-quotes = "single" # To prefer single quotes over double quote
[tool.ruff.lint.isort]
known-first-party = ["kobo"]

Expand Down

0 comments on commit 50b53fe

Please sign in to comment.