fix PEP8 E303 and make the code check more strict

This commit is contained in:
alfrix 2022-08-22 09:50:02 -03:00 committed by Alfredo Monclus
parent ce8762da19
commit e986e3cd8e
4 changed files with 3 additions and 8 deletions

View File

@ -2,7 +2,7 @@ name: test-code
on: [push, pull_request]
jobs:
lint-python-code:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ricardochaves/python-lint@v1.4.0
@ -14,4 +14,4 @@ jobs:
use-black: false
use-mypy: false
use-isort: false
extra-pycodestyle-options: "--ignore=E226,E301,E302,E303,E402,W503,W504 --max-line-length=120 --max-doc-length=120"
extra-pycodestyle-options: "--ignore=E402,W503,W504 --max-line-length=120 --max-doc-length=120"

View File

@ -17,7 +17,6 @@ try:
ctypes.cdll.LoadLibrary('libXext.so.6')
libXext = ctypes.CDLL('libXext.so.6')
class DPMS_State:
Fail = -1
On = 0
@ -25,7 +24,6 @@ try:
Suspend = 2
Off = 3
def get_DPMS_state(display_name_in_byte_string=b':0'):
state = DPMS_State.Fail
if not isinstance(display_name_in_byte_string, bytes):
@ -48,7 +46,6 @@ try:
libXext.XCloseDisplay(display)
return state
dpms_loaded = True
except Exception:
pass

View File

@ -142,7 +142,6 @@ class BedMeshPanel(ScreenPanel):
button_box.add(buttons["load"])
button_box.add(buttons["view"])
box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
box.pack_start(name, True, True, 0)
box.pack_start(button_box, False, False, 0)
@ -177,7 +176,6 @@ class BedMeshPanel(ScreenPanel):
return True
return False
def load_meshes(self):
bm_profiles = self._screen.printer.get_config_section_list("bed_mesh ")
logging.info(f"Bed profiles: {bm_profiles}")

View File

@ -1,3 +1,3 @@
#!/bin/bash
pycodestyle --ignore=E226,E301,E302,E303,E402,W503,W504 --max-line-length=120 --max-doc-length=120 screen.py ks_includes panels
pycodestyle --ignore=E402,W503,W504 --max-line-length=120 --max-doc-length=120 screen.py ks_includes panels