Skip to content

Commit 0826364

Browse files
authored
Merge pull request #14 from Quasars/ruff
[MAINT] ruff
2 parents b264d39 + 128cac9 commit 0826364

File tree

4 files changed

+25
-40
lines changed

4 files changed

+25
-40
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,17 @@
11
repos:
2-
- repo: https://github.com/asottile/pyupgrade
3-
rev: v3.15.0
4-
hooks:
5-
- id: pyupgrade
6-
args: ["--py39-plus"]
7-
- repo: https://github.com/psf/black
8-
rev: 23.1.0
9-
hooks:
10-
- id: black
112
- repo: https://github.com/pre-commit/pre-commit-hooks
123
rev: v4.5.0
134
hooks:
145
- id: check-ast
156
- id: trailing-whitespace
167
- id: end-of-file-fixer
178
- id: mixed-line-ending
18-
- repo: https://github.com/pycqa/flake8
19-
rev: 6.1.0
9+
- repo: https://github.com/astral-sh/ruff-pre-commit
10+
# Ruff version.
11+
rev: v0.13.2
2012
hooks:
21-
- id: flake8
22-
additional_dependencies:
23-
- flake8-bugbear
24-
- flake8-comprehensions
25-
- pep8-naming
26-
- flake8-black
27-
- flake8-pyproject
13+
# Run the linter.
14+
- id: ruff-check
15+
# Run the formatter.
16+
- id: ruff-format
17+
exclude: 'heterodyne_postprocessing'

pyproject.toml

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,10 @@ doc = [
3131
test = [
3232
"pytest",
3333
"coverage",
34-
"flake8",
35-
"flake8-bugbear",
36-
"flake8-pyproject",
37-
"black",
3834
]
3935
dev = [
4036
"pre-commit",
37+
"ruff",
4138
]
4239

4340
[project.urls]
@@ -59,20 +56,12 @@ html-index = "orangecontrib.protospec.widgets:WIDGET_HELP_PATH"
5956
[tool.setuptools.packages.find]
6057
where = ["src"]
6158

62-
[tool.black]
63-
skip_string_normalization = '1'
64-
force-exclude = '''.*heterodyne_postprocessing.*'''
65-
66-
[tool.flake8]
67-
# Black compatibility
68-
max-line-length = 88
69-
extend-ignore = [
70-
# See https://github.com/PyCQA/pycodestyle/issues/373
71-
'E203',
72-
# Ignore this since we use PyQt5 basically everywhere.
73-
'N802',
74-
# https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#line-length
75-
'E501',
76-
]
77-
extend-select = ['B590']
59+
[tool.ruff]
7860
exclude = ['heterodyne_postprocessing']
61+
force-exclude = true
62+
63+
[tool.ruff.lint]
64+
select = ["E4", "E7", "E9", "F", "B", "UP"]
65+
66+
[tool.ruff.format]
67+
quote-style = "preserve"

src/orangecontrib/protospec/data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def read_domain(sub):
3838
if f'{sub}_args' in d
3939
else ['{}'] * len(subdomain)
4040
)
41-
for attr, args in zip(subdomain, subdomain_args):
41+
for attr, args in zip(subdomain, subdomain_args, strict=False):
4242
yield attr[0], attr[1], json.loads(args)
4343

4444
def make_var(name, header, args):
@@ -235,7 +235,7 @@ def read(self):
235235
data = np.asarray(data, dtype=np.float64) # Orange assumes X to be float64
236236
features = []
237237
for i, f in enumerate(domvals):
238-
var = Orange.data.ContinuousVariable.make("%f" % f)
238+
var = Orange.data.ContinuousVariable.make("%f" % f) # noqa: UP031
239239
for k, v in var_attr_d.items():
240240
var.attributes[k] = v[i]
241241
features.append(var)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[lint]
2+
# Allow the use of in_data in these scripts
3+
ignore = ["F821"]
4+
5+
[format]
6+
exclude = ['*']

0 commit comments

Comments
 (0)