Skip to content

Commit

Permalink
style: update ruff version
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Jul 29, 2024
1 parent 9b5f919 commit 14d2e67
Show file tree
Hide file tree
Showing 8 changed files with 512 additions and 478 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.0
rev: v0.5.0 # ruff version
hooks:
- id: ruff-format
- id: ruff
Expand Down
22 changes: 18 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dynamic = ["version"]

[project.optional-dependencies]
tests = ["pytest", "pytest-cov", "pytest-benchmark", "requests_mock"]
dev = ["pre-commit", "ruff==0.2.0"]
dev = ["pre-commit", "ruff==0.5.0"]
docs = [
"sphinx==6.1.3",
"sphinx-autodoc-typehints==1.22.0",
Expand Down Expand Up @@ -90,16 +90,22 @@ lint.select = [
"DTZ", # https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"T10", # https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"EM", # https://docs.astral.sh/ruff/rules/#flake8-errmsg-em
"LOG", # https://docs.astral.sh/ruff/rules/#flake8-logging-log
"G", # https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
"INP", # https://docs.astral.sh/ruff/rules/#flake8-no-pep420-inp
"PIE", # https://docs.astral.sh/ruff/rules/#flake8-pie-pie
"T20", # https://docs.astral.sh/ruff/rules/#flake8-print-t20
"PT", # https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
"Q", # https://docs.astral.sh/ruff/rules/#flake8-quotes-q
"RSE", # https://docs.astral.sh/ruff/rules/#flake8-raise-rse
"RET", # https://docs.astral.sh/ruff/rules/#flake8-return-ret
"SLF", # https://docs.astral.sh/ruff/rules/#flake8-self-slf
"SIM", # https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"ARG", # https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg
"PTH", # https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
"PGH", # https://docs.astral.sh/ruff/rules/#pygrep-hooks-pgh
"PERF", # https://docs.astral.sh/ruff/rules/#perflint-perf
"FURB", # https://docs.astral.sh/ruff/rules/#refurb-furb
"RUF", # https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
]
lint.fixable = [
Expand All @@ -110,16 +116,20 @@ lint.fixable = [
"ANN",
"B",
"C4",
"LOG",
"G",
"PIE",
"PT",
"RSE",
"SIM",
"PERF",
"FURB",
"RUF"
]

# ANN101 - missing-type-self
# ANN003 - missing-type-kwargs
# ANN101 - missing-type-self
# ANN102 - missing-type-cls
# D203 - one-blank-line-before-class
# D205 - blank-line-after-summary
# D206 - indent-with-spaces*
Expand All @@ -134,7 +144,7 @@ lint.fixable = [
# W191 - tab-indentation*
# *ignored for compatibility with formatter
lint.ignore = [
"ANN101", "ANN003",
"ANN003", "ANN101", "ANN102",
"D203", "D205", "D206", "D213", "D300", "D400", "D415",
"E111", "E114", "E117", "E501",
"W191",
Expand All @@ -150,4 +160,8 @@ lint.ignore = [
# D103 - undocumented-public-function
# S101 - assert
# B011 - assert-false
"tests/*" = ["ANN001", "ANN102", "ANN2", "S101", "B011", "D100", "D101", "D103"]
# INP001 - implicit-namespace-package
"tests/*" = ["ANN001", "ANN102", "ANN2", "S101", "B011", "D100", "D101", "D103", "INP001"]

[tool.ruff.format]
docstring-code-format = true
15 changes: 8 additions & 7 deletions src/dgipy/dgidb.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,10 @@ def __process_gene_search(results: dict) -> pd.DataFrame:
approval_list.append(str(interaction["drug"]["approved"]))
interactionscore_list.append(interaction["interactionScore"])

list_string = []
for attribute in interaction["interactionAttributes"]:
list_string.append(f"{attribute['name']}: {attribute['value']}")
list_string = [
f"{attribute['name']}: {attribute['value']}"
for attribute in interaction["interactionAttributes"]
]
interactionattributes_list.append(" | ".join(list_string))

list_string = []
Expand Down Expand Up @@ -573,10 +574,10 @@ def __process_drug_search(results: dict) -> pd.DataFrame:
interactionscore_list.append(interaction["interactionScore"])
approval_list.append(current_approval)

list_string = []
for attribute in interaction["interactionAttributes"]:
list_string.append(f"{attribute['name']}: {attribute['value']}")

list_string = [
f"{attribute['name']}: {attribute['value']}"
for attribute in interaction["interactionAttributes"]
]
interactionattributes_list.append("| ".join(list_string))

list_string = []
Expand Down
Loading

0 comments on commit 14d2e67

Please sign in to comment.