Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: enable pylint E and F rule classes #222

Merged
merged 14 commits into from
Jul 16, 2024
Merged
2 changes: 1 addition & 1 deletion .github/workflows/python-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
matrix:
python-version: ["3.11", "3.12"]
os: ["windows-latest", "ubuntu-latest", "macos-latest"]
os: ["windows-latest", "ubuntu-latest"]
env:
SKIP: no-commit-to-branch
steps:
Expand Down
13 changes: 12 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ci:
autofix_commit_msg: "chore(pre-commit.ci): auto fixes"
autoupdate_commit_msg: "chore(pre-commit.ci): pre-commit autoupdate"
autoupdate_schedule: weekly
skip: [mypy]
skip: [mypy, pylint]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down Expand Up @@ -56,3 +56,14 @@ repos:
entry: mypy
language: system
types: [python]
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
args: [
"-rn", # Only display messages
"-sn", # Don't display the score
"--rcfile=pylintrc",
"--ignore-paths=tests",
]
4 changes: 2 additions & 2 deletions midealocal/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def connect(
file = None
lineno = None
if e.__traceback__:
file = e.__traceback__.tb_frame.f_globals["__file__"]
file = e.__traceback__.tb_frame.f_globals["__file__"] # pylint: disable=E1101
lineno = e.__traceback__.tb_lineno
_LOGGER.exception(
"[%s] Unknown error : %s, %s",
Expand Down Expand Up @@ -555,7 +555,7 @@ def run(self) -> None:
file = None
lineno = None
if e.__traceback__:
file = e.__traceback__.tb_frame.f_globals["__file__"]
file = e.__traceback__.tb_frame.f_globals["__file__"] # pylint: disable=E1101
lineno = e.__traceback__.tb_lineno
_LOGGER.exception(
"[%s] Unknown error : %s, %s",
Expand Down
8 changes: 4 additions & 4 deletions midealocal/devices/ac/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,8 @@ def _body(self) -> bytearray:
)
if self.fresh_air_1 is not None and len(self.fresh_air_1) == FRESH_AIR_LENGTH:
pack_count += 1
fresh_air_power = 2 if self.fresh_air_1[0] > 0 else 1
fresh_air_fan_speed = self.fresh_air_1[1]
fresh_air_power = 2 if next(iter(self.fresh_air_1)) > 0 else 1
fresh_air_fan_speed = list(self.fresh_air_1)[1]
payload.extend(
NewProtocolMessageBody.pack(
param=NewProtocolTags.fresh_air_1,
Expand All @@ -597,8 +597,8 @@ def _body(self) -> bytearray:
)
if self.fresh_air_2 is not None and len(self.fresh_air_2) == FRESH_AIR_LENGTH:
pack_count += 1
fresh_air_power = 1 if self.fresh_air_2[0] > 0 else 0
fresh_air_fan_speed = self.fresh_air_2[1]
fresh_air_power = 1 if next(iter(self.fresh_air_2)) > 0 else 0
fresh_air_fan_speed = list(self.fresh_air_2)[1]
payload.extend(
NewProtocolMessageBody.pack(
param=NewProtocolTags.fresh_air_2,
Expand Down
Loading
Loading