Skip to content

Commit

Permalink
Remove flake8 and replace it by ruff (#716)
Browse files Browse the repository at this point in the history
* Accommodate for `score_metric` for search and `termset_pairwise_similarity`

* pip needed

* pip needed

* added 3.12 support

* formatted

* fixed poetry's pip problem

* flake8 removed

* manage upto 3.11

* just lint 3.12

* adressed/ignored a few rules

* timeout=30

* formatted

* addressed a few more rules

* fixed error

* formatted

* cleanup
  • Loading branch information
hrshdhgd authored Mar 14, 2024
1 parent 9d05234 commit a519291
Show file tree
Hide file tree
Showing 118 changed files with 453 additions and 312 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.9', '3.10' ]
python-version: [ '3.9', '3.10', '3.12' ]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -25,15 +25,15 @@ jobs:
- name: Install dependencies
run: |
pip install tox
- name: Check code quality with flake8
run: tox -e flake8
- name: Check code quality with ruff
run: tox -e lint

test:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
python-version: [ "3.9", "3.10" ]
python-version: [ "3.9", "3.10", "3.11" ]
exclude:
- os: windows-latest
python-version: "3.9"
Expand Down
4 changes: 2 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ tox = "*"

[tool.poetry.group.dev.dependencies]
seaborn = "^0.12.2"
pip = "^24.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down Expand Up @@ -91,3 +92,38 @@ reverse_relative = true
skip = '.git,*.pdf,*.svg,poetry.lock,*.obo,*.ttl,*.ofn,*.gaf,*.tsv,*.json,input'
ignore-regex = '(^\s*"image/\S+": ".*|[a-z]*\.\.\.)'
ignore-words-list = 'ptd,ot,nd,ser,oger,gard,te,fo,fof,bu,ue,ois,processus,infarction,infarctions'

[tool.ruff]
lint.extend-ignore = [
"D211", # `no-blank-line-before-class`
"D212", # `multi-line-summary-first-line`
"E731", # Do not assign a `lambda` expression, use a `def`
"B005", # Using `.strip()` with multi-character strings is misleading the reader
"S101", # Use of `assert` detected
"S607", # Starting a process with a partial executable path
"S608", # Possible SQL injection vector through string-based query construction
"S603", # `subprocess` call: check for execution of untrusted input
]
lint.exclude = ["src/oaklib/datamodels/*"]
line-length = 120

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

# Select or ignore from https://beta.ruff.rs/docs/rules/
lint.select = [
"B", # bugbear
# "D", # pydocstyle
"E", # pycodestyle errors
"F", # Pyflakes
"I", # isort
"S", # flake8-bandit
"W", # Warning
]

lint.unfixable = []
target-version = "py310"

[tool.ruff.lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
Loading

0 comments on commit a519291

Please sign in to comment.