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

pep8 loose compliance #4086

Closed
totaam opened this issue Dec 26, 2023 · 2 comments
Closed

pep8 loose compliance #4086

totaam opened this issue Dec 26, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@totaam
Copy link
Collaborator

totaam commented Dec 26, 2023

A flake8 config was added to https://github.com/Xpra-org/xpra/blob/master/pyproject.toml in 9ab64d9.
Then lots of minor fixes in 1618eef + 8aae423 for xpra/x11, 263497a for xpra/util and 633fafa for xpra/notifications, xpra/dbus and xpra/gstreamer.

What's left as of 9fbf6db:

$ find xpra/* -maxdepth 0 -type d -exec echo -n "{}    " \; -exec bash -c "pflake8 {} | wc -l" \;
xpra/audio    0
xpra/buffers    0
xpra/client    2173
xpra/clipboard    0
xpra/codecs    737
xpra/dbus    0
xpra/gstreamer    0
xpra/gtk    795
xpra/keyboard    0
xpra/net    1237
xpra/notifications    0
xpra/platform    3200
xpra/scripts    1020
xpra/server    2594
xpra/util    0
xpra/x11    0
@totaam totaam added the enhancement New feature or request label Dec 26, 2023
totaam added a commit that referenced this issue Dec 26, 2023
totaam added a commit that referenced this issue Dec 26, 2023
totaam added a commit that referenced this issue Dec 26, 2023
@totaam
Copy link
Collaborator Author

totaam commented Dec 26, 2023

Better now:

find xpra/* -maxdepth 0 -type d -exec echo -n "{}    " \; -exec bash -c "pflake8 {} | wc -l" \; | grep -ve ' 0$'
xpra/client    2173
xpra/net    1237
xpra/platform    3200
xpra/scripts    1020
xpra/server    2594

@totaam
Copy link
Collaborator Author

totaam commented Dec 28, 2023

Good enough for now, down to zero warnings with the config we ship, which ignores only a few modules / warnings:

xpra/pyproject.toml

Lines 29 to 53 in e10dbff

[tool.flake8]
max-line-length = 120
exclude = ["xpra/gtk/examples/*.py", "xpra/platform/win32/*", "xpra/platform/darwin/*"]
ignore = ["E203", "E231", "E225", "E226", "E252", "E221", "E741", "E262", "E265"]
per-file-ignores = """
xpra/audio/gstreamer_util.py:E241
xpra/keyboard/layouts.py:E241,E501
xpra/x11/gtk_x11/wm_check.py:E241
xpra/x11/server/seamless.py:E241
xpra/codecs/nvidia/util.py:E241
xpra/codecs/loader.py:E241
xpra/codecs/checks.py:E501
xpra/gtk/versions.py:E241
xpra/client/mixins/windows.py:E241
xpra/client/gui/paint_colors.py:E241
xpra/scripts/config.py:E241
xpra/net/rfb/d3des.py:E241
xpra/server/source/source_stats.py:E116,E501
xpra/server/window/compress.py:E501
xpra/server/mixins/fileprint.py:E241
xpra/server/mixins/controlcommands.py:E501,E241
xpra/platform/gui.py:E241
xpra/platform/paths.py:E302
xpra/platform/posix/gui.py:E241
"""

Nothing major here:

  • examples and platform modules (macos and win32)
  • E203 whitespace before ':': 5504 hits
  • E221 multiple spaces before operator: 351
  • E231 missing whitespace after..: 2862
  • E252 missing whitespace around parameter equals: 628
  • E262 inline comment should start with '# ': 224
  • E265 block comment should start with '# ' : 1653
  • E741 ambiguous variable name..: 145

@totaam totaam closed this as completed Dec 28, 2023
totaam added a commit that referenced this issue Dec 29, 2023
@totaam totaam mentioned this issue Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant