Skip to content

Commit

Permalink
Merge branch 'main' into remove-pipfile
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Mar 22, 2024
2 parents a782bc4 + 2865a3b commit 412c918
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 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.1.14
rev: v0.2.0
hooks:
- id: ruff-format
- id: ruff
Expand Down
17 changes: 10 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dynamic = ["version"]
[project.optional-dependencies]
etl = ["disease-normalizer[etl]~=0.4.0.dev0", "owlready2", "rdflib", "wikibaseintegrator>=0.12.0", "wags-tails"]
test = ["pytest", "pytest-cov", "pytest-mock"]
dev = ["pre-commit", "ruff>=0.1.14", "lxml", "xmlformatter", "mypy", "types-pyyaml"]
dev = ["pre-commit", "ruff==0.2.0", "lxml", "xmlformatter", "mypy", "types-pyyaml"]

[project.urls]
Homepage = "https://github.com/cancervariants/therapy-normalization"
Expand Down Expand Up @@ -76,6 +76,8 @@ ignore_missing_imports = true

[tool.ruff]
src = ["src"]

[tool.ruff.lint]
select = [
"F", # https://docs.astral.sh/ruff/rules/#pyflakes-f
"E", "W", # https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
Expand Down Expand Up @@ -132,26 +134,27 @@ fixable = [
# E114 - indentation-with-invalid-multiple-comment*
# E117 - over-indented*
# E501 - line-too-long*
# W191 - tab-indentation*
# PGH003 - blanket-type-ignore
# W191 - tab-indentation*
# S321 - suspicious-ftp-lib-usage
# *ignored for compatibility with formatter
ignore = [
"ANN101", "ANN003",
"D203", "D205", "D206", "D213", "D300", "D400", "D415",
"E111", "E114", "E117", "E501",
"W191",
"PGH003",
"W191",
"S321",
]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
# ANN001 - missing-type-function-argument
# ANN2 - missing-return-type
# ANN201 - Missing type annotation
# ANN102 - missing-type-cls
# N805 - invalid-first-argument-name-for-method
# S101 - assert
# B011 - assert-false
# N805 - invalid-first-argument-name-for-method
# RUF001 - ambiguous-unicode-character-string
"tests/*" = ["ANN001", "ANN102", "ANN2", "S101", "B011"]
"tests/*" = ["ANN001", "ANN2", "ANN102", "S101", "B011"]
"tests/unit/test_emit_warnings.py" = ["RUF001"]
"src/therapy/schemas.py" = ["ANN001", "ANN201", "N805"]
2 changes: 1 addition & 1 deletion src/therapy/etl/rxnorm.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def _add_term(params: Dict, term: str, label_type: str) -> None:
:param Str term: The term to be added
:param Str label_type: The type of term
"""
if label_type in params and params[label_type]:
if params.get(label_type):
if term not in params[label_type]:
params[label_type].append(term)
else:
Expand Down

0 comments on commit 412c918

Please sign in to comment.