Skip to content

Commit

Permalink
Minor ruff lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gvalkov committed Feb 18, 2024
1 parent 67f4902 commit 8ee96b0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-

import sys, os
import os
import sys
import sphinx_rtd_theme

# Check if readthedocs is building us
Expand Down
4 changes: 2 additions & 2 deletions evdev/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ def __del__(self):
def _capabilities(self, absinfo=True):
res = {}

for etype, ecodes in self._rawcapabilities.items():
for code in ecodes:
for etype, _ecodes in self._rawcapabilities.items():
for code in _ecodes:
l = res.setdefault(etype, [])
if isinstance(code, tuple):
if absinfo:
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ packages = ["evdev"]

[tool.ruff]
line-length = 120

[tool.ruff.lint]
ignore = ["E265", "E241", "F403", "F401", "E401", "E731"]
11 changes: 5 additions & 6 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pytest ~= 7.1.0
Sphinx ~= 4.4.0
sphinx-copybutton ~= 0.5.0
bump2version
sphinx_rtd_theme
twine
pytest
Sphinx
sphinx-copybutton ~= 0.5.2
sphinx-rtd-theme
ruff
bump-my-version ~= 0.17.4
6 changes: 3 additions & 3 deletions tests/test_ecodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
prefixes = "KEY ABS REL SW MSC LED BTN REP SND ID EV BUS SYN FF_STATUS FF"


def to_tuples(l):
def to_tuples(val):
t = lambda x: tuple(x) if isinstance(x, list) else x
return map(t, l)
return map(t, val)


def test_equality():
Expand All @@ -28,4 +28,4 @@ def test_access():
def test_overlap():
vals_ff = set(to_tuples(ecodes.FF.values()))
vals_ff_status = set(to_tuples(ecodes.FF_STATUS.values()))
assert bool(vals_ff & vals_ff_status) == False
assert bool(vals_ff & vals_ff_status) is False

0 comments on commit 8ee96b0

Please sign in to comment.