Skip to content

Commit c80f4e9

Browse files
committed
"Update ruff pre-commit hook
"
1 parent 35fd2dd commit c80f4e9

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repos:
1010
- id: end-of-file-fixer
1111
- id: trailing-whitespace
1212
- repo: https://github.com/astral-sh/ruff-pre-commit
13-
rev: v0.3.4
13+
rev: v0.15.8
1414
hooks:
1515
- id: ruff-format
1616
- id: ruff

adafruit_lps2x.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def pressure(self) -> float:
179179
raw = self._raw_pressure
180180

181181
if raw & (1 << 23) != 0:
182-
raw = raw - (1 << 24)
182+
raw -= 1 << 24
183183
return raw / 4096.0
184184

185185
@property

examples/lps2x_simpletest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
lps = adafruit_lps2x.LPS25(i2c)
1515

1616
while True:
17-
print("Pressure: %.2f hPa" % lps.pressure)
18-
print("Temperature: %.2f C" % lps.temperature)
17+
print(f"Pressure: {lps.pressure:.2f} hPa")
18+
print(f"Temperature: {lps.temperature:.2f} C")
1919
time.sleep(1)

0 commit comments

Comments
 (0)