Skip to content

Commit

Permalink
move to ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 committed Oct 2, 2023
1 parent 713f6a1 commit bf97761
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 16 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/components_instructor_embedders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ jobs:
run: |
pip install -e .[dev]
- name: Pylint
run: |
pylint -ry -j 0 ./instructor_embedders
- name: Ruff
uses: chartboost/ruff-action@v1

- name: Run tests
run: |
Expand Down
65 changes: 52 additions & 13 deletions components/instructor-embedders/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ dependencies = [
]

[project.optional-dependencies]
dev = ["pytest", "pylint", "black"]
dev = ["pytest"]

[project.urls]
Documentation = "https://github.com/deepset-ai/haystack-extras/tree/main/components/instructor-embedders#readme"
Expand Down Expand Up @@ -75,21 +75,60 @@ omit = ["instructor_embedders/__about__.py"]
[tool.coverage.report]
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]

[tool.pylint.'MESSAGES CONTROL']
max-line-length = 120
disable = ["missing-module-docstring", "fixme", "R0913", "W0221"]
[tool.ruff]
target-version = "py37"
line-length = 120
select = [
"A",
"ARG",
"B",
"C",
"DTZ",
"E",
"EM",
"F",
"FBT",
"I",
"ICN",
"ISC",
"N",
"PLC",
"PLE",
"PLR",
"PLW",
"Q",
"RUF",
"S",
"T",
"TID",
"UP",
"W",
"YTT",
]
ignore = [
# Allow non-abstract empty methods in abstract base classes
"B027",
# Allow boolean positional values in function calls, like `dict.get(... True)`
"FBT003",
# Ignore checks for possible passwords
"S105", "S106", "S107",
# Ignore complexity
"C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915",
]
unfixable = [
# Don't touch unused imports
"F401",
]

[tool.pylint.'DESIGN']
max-args = 7
[tool.ruff.isort]
known-first-party = ["instructor_embedders"]

[tool.pylint.'SIMILARITIES']
min-similarity-lines = 10
ignore-comments = true
[tool.ruff.flake8-tidy-imports]
ban-relative-imports = "all"

[tool.pylint.'TYPECHECK']
# List of members which are set dynamically and missed by Pylint inference
# system, and so shouldn't trigger E1101 when accessed.
generated-members = "torch.*"
[tool.ruff.per-file-ignores]
# Tests can use magic values, assertions, and relative imports
"tests/**/*" = ["PLR2004", "S101", "TID252"]

[tool.pytest.ini_options]
minversion = "6.0"
Expand Down

0 comments on commit bf97761

Please sign in to comment.