Skip to content

Commit 9a2a49c

Browse files
committed
Add ruff formatter
1 parent 41fca05 commit 9a2a49c

File tree

4 files changed

+22
-34
lines changed

4 files changed

+22
-34
lines changed

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-FileCopyrightText: 2024 Justin Myers for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
5+
* text eol=lf

.pre-commit-config.yaml

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,19 @@
1-
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
1+
# SPDX-FileCopyrightText: 2024 Justin Myers for Adafruit Industries
22
#
33
# SPDX-License-Identifier: Unlicense
44

55
repos:
6-
- repo: https://github.com/python/black
7-
rev: 23.3.0
8-
hooks:
9-
- id: black
10-
- repo: https://github.com/fsfe/reuse-tool
11-
rev: v1.1.2
12-
hooks:
13-
- id: reuse
146
- repo: https://github.com/pre-commit/pre-commit-hooks
15-
rev: v4.4.0
7+
rev: v4.5.0
168
hooks:
179
- id: check-yaml
1810
- id: end-of-file-fixer
1911
- id: trailing-whitespace
20-
- repo: https://github.com/pycqa/pylint
21-
rev: v2.17.4
12+
- repo: https://github.com/astral-sh/ruff-pre-commit
13+
rev: v0.3.4
2214
hooks:
23-
- id: pylint
24-
name: pylint (library code)
25-
types: [python]
26-
args:
27-
- --disable=consider-using-f-string
28-
exclude: "^(docs/|examples/|tests/|setup.py$)"
29-
- id: pylint
30-
name: pylint (example code)
31-
description: Run pylint rules on "examples/*.py" files
32-
types: [python]
33-
files: "^examples/"
34-
args:
35-
- --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code
36-
- id: pylint
37-
name: pylint (test code)
38-
description: Run pylint rules on "tests/*.py" files
39-
types: [python]
40-
files: "^tests/"
41-
args:
42-
- --disable=missing-docstring,consider-using-f-string,duplicate-code
15+
- id: ruff-format
16+
- repo: https://github.com/fsfe/reuse-tool
17+
rev: v3.0.1
18+
hooks:
19+
- id: reuse

adafruit_bme680.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ def __init__(
662662
address: int = 0x77,
663663
debug: bool = False,
664664
*,
665-
refresh_rate: int = 10
665+
refresh_rate: int = 10,
666666
) -> None:
667667
"""Initialize the I2C device at the 'address' given"""
668668
from adafruit_bus_device import ( # pylint: disable=import-outside-toplevel
@@ -751,7 +751,7 @@ def __init__(
751751
baudrate: int = 100000,
752752
debug: bool = False,
753753
*,
754-
refresh_rate: int = 10
754+
refresh_rate: int = 10,
755755
) -> None:
756756
from adafruit_bus_device import ( # pylint: disable=import-outside-toplevel
757757
spi_device,

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ classifiers = [
4141
]
4242
dynamic = ["dependencies", "optional-dependencies"]
4343

44+
[tool.ruff]
45+
target-version = "py38"
46+
47+
[tool.ruff.format]
48+
line-ending = "lf"
49+
4450
[tool.setuptools]
4551
py-modules = ["adafruit_bme680"]
4652

0 commit comments

Comments
 (0)