Skip to content

Commit

Permalink
Add ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
oerc0122 committed Jan 30, 2025
1 parent 537d3fa commit 3b61454
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 26 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/black.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Lint

on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"

jobs:
lint_format_ruff:
runs-on: ubuntu-latest
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v3
with:
src: "MDANSE/src"
- name: Analysing the code with Ruff
run: |
ruff format --check
lint_ruff:
runs-on: ubuntu-latest
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v3
with:
src: "MDANSE/src"
- name: Analysing the code with Ruff
run: |
ruff check
lint-mdanse-gui:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: psf/black@stable
with:
options: "--check --verbose"
src: "MDANSE_GUI/Src"
40 changes: 40 additions & 0 deletions MDANSE/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,45 @@ package-dir = {"" = "src"}
[project.scripts]
mdanse = "MDANSE.Scripts.mdanse:main"

[tool.ruff]
line-length = 100
indent-width = 4
target-version = "py39"

[tool.ruff.lint]
select = [
"E4", "E7", "E9", "F", # Defaults
# "PL", # Pylint errors
# "E", # Pycodestyle
# "W", # Pycodestyle warnings
# "F", # Pyflakes
# "B", # Flake8 bugbear
# "SIM", # Flake8 Simplify
# "A", # Flake8 builtins
# "COM", # Flake8 commas
# "ISC", # Flake8 implicit string concat
# "RSE", # Flake8 raise
# "FA", # Flake8 future
# "FBT", # Flake8 boolean trap
# "C4", # Flake8 comprehensions
# "Q", # Flake8 Quotes
# "RET", # Flake8 return
# "ARG", # Flake8 unused args
# "PTH", # Flake8 use pathlib
# "I", # Isort
# "RUF", # Ruff specific
# "FURB",# Refurb
# "PERF",# Perflint
# "D", # Pydocstyle
# "UP", # Pyupgrade
]
ignore = [
"F401", # Unused import in init
"E402", # Import not at top
"PLR0913", # Too many arguments
"PLR0912", # Too many branches
"PLR0915", # Too many statements
]

# [tool.setuptools.packages.find]
# where = ["src"]

0 comments on commit 3b61454

Please sign in to comment.