Skip to content

Commit

Permalink
♻️ use ruff instead of pylint
Browse files Browse the repository at this point in the history
* upgrade version of github actions checkout task
  • Loading branch information
florianholzapfel committed Dec 1, 2023
1 parent 7cbefec commit 09e311a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pylint.yml → .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Pylint
name: ruff

on: [push]

Expand All @@ -7,18 +7,18 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.12"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
pip install ruff
pip install -r requirements.txt
- name: Analysing the code with pylint
run: |
pylint ./panasonic_viera/__init__.py ./panasonic_viera/__main__.py
ruff check .
3 changes: 2 additions & 1 deletion panasonic_viera/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
DEFAULT_PORT = 55000

BLOCK_SIZE = 16 # Bytes
pad = lambda s: s + (BLOCK_SIZE - len(s) % BLOCK_SIZE) * chr(0)
def pad(s):
return s + (BLOCK_SIZE - len(s) % BLOCK_SIZE) * chr(0)

class Keys(Enum):
"""Contains all known keys."""
Expand Down
5 changes: 3 additions & 2 deletions panasonic_viera/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def runsource(code_console, source, filename=None, symbol=None):
return False

try:
import readline; readline
import readline
readline
except ImportError:
pass

Expand All @@ -76,7 +77,7 @@ def runsource(code_console, source, filename=None, symbol=None):
finally:
sys.ps1, sys.ps2 = ps1, ps2

def run(self, file_descriptor=None):
def run(self, file_descriptor=None): # noqa: F811
if file_descriptor is None:
file_descriptor = sys.stdin
if file_descriptor.isatty():
Expand Down

0 comments on commit 09e311a

Please sign in to comment.