Skip to content

Commit e849926

Browse files
committed
PEP8 naming convention
1 parent bbcabb0 commit e849926

File tree

22 files changed

+1051
-1049
lines changed

22 files changed

+1051
-1049
lines changed

.flake8

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ color=always
33
max-line-length=120
44
; Auto generated
55
exclude=src/gen/
6-
; TODO: We want to configure this
7-
ignore=W503,N801,N802,N803,N806,N815,N816
8-
per-file-ignores =
9-
; imported but unused
10-
; line too long
11-
; mixed case
12-
__init__.pyi:F401,E501,N816
13-
; TODO: Bring WAY down
6+
ignores=Y015
7+
per-file-ignores=
8+
; Quotes
9+
__init__.pyi:Q000
10+
; PyQt methods
11+
ignore-names=closeEvent,paintEvent,keyPressEvent,mousePressEvent,mouseMoveEvent,mouseReleaseEvent
12+
; TODO: Bring down to 15, same as SonarLint
1413
max-complexity=55
15-
inline-quotes = "
14+
inline-quotes="

.github/workflows/lint-and-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
- master
1717
- dev
1818
- dev*
19+
- 2.0.0
1920
paths:
2021
- '**.py'
2122
- '**.pyi'

PyInstaller/hooks/hook-cv2.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# ------------------------------------------------------------------
2+
# Copyright (c) 2020 PyInstaller Development Team.
3+
#
4+
# This file is distributed under the terms of the GNU General Public
5+
# License (version 2.0 or later).
6+
#
7+
# The full license is available in LICENSE.GPL.txt, distributed with
8+
# this software.
9+
#
10+
# SPDX-License-Identifier: GPL-2.0-or-later
11+
# ------------------------------------------------------------------
12+
# https://github.com/pyinstaller/pyinstaller-hooks-contrib/blob/master/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-cv2.py
13+
14+
from PyInstaller.utils.hooks import collect_dynamic_libs, collect_data_files
15+
16+
hiddenimports = ["numpy"]
17+
18+
# Include any DLLs from site-packages/cv2 (opencv_videoio_ffmpeg*.dll can be found there in the PyPI version)
19+
binaries = collect_dynamic_libs("cv2")
20+
21+
# https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/110
22+
# OpenCV loader from 4.5.4.60 requires extra config files and modules
23+
datas = collect_data_files("cv2", include_py_files=True, includes=["**/*.py"])

pyproject.toml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ reportUnknownMemberType = "none"
3636
# https://pylint.pycqa.org/en/latest/technical_reference/features.html
3737
[tool.pylint.REPORTS]
3838
# Just like default but any error will make drop to 9 or less
39-
evaluation="10.0 - error - ((float(warning + refactor + convention) / statement) * 10)"
39+
evaluation = "10.0 - error - ((float(warning + refactor + convention) / statement) * 10)"
4040
[tool.pylint.MASTER]
41-
fail-under=9.0
41+
fail-under = 9.0
4242
# https://pylint.pycqa.org/en/latest/technical_reference/extensions.html
4343
load-plugins = [
4444
"pylint.extensions.emptystring",
@@ -71,18 +71,27 @@ ignore-paths = [
7171
"^src/gen/.*$",
7272
]
7373
# No need to mention the fixmes
74-
disable=["fixme"]
74+
disable = ["fixme"]
7575
extension-pkg-allow-list = ["PyQt6", "win32ui"]
7676

7777
[tool.pylint.FORMAT]
7878
max-line-length = 120
7979

8080
[tool.pylint.'MESSAGES CONTROL']
81+
# Same as SonarLint
82+
max-complexity = 15
83+
max-branches = 15
84+
# https://pylint.pycqa.org/en/latest/user_guide/options.html#naming-styles
85+
module-naming-style = "any"
86+
# Can't make private class with PascalCase
87+
class-rgx = "_?_?[a-zA-Z]+?$"
88+
good-names = [
89+
# PyQt methods
90+
"closeEvent", "paintEvent", "keyPressEvent", "mousePressEvent", "mouseMoveEvent", "mouseReleaseEvent",
91+
# https://github.com/PyCQA/pylint/issues/2018
92+
"x", "y", "a0", "i", "t0", "t1"]
8193
disable = [
8294
"missing-docstring",
83-
# TODO: We want to configure this
84-
# https://pylint.pycqa.org/en/latest/user_guide/options.html#naming-styles
85-
"invalid-name",
8695
# We group imports
8796
"wrong-import-position",
8897
# Already taken care of and grayed out. Also conflicts with Pylance reportIncompatibleMethodOverride

res/about.ui

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ui version="4.0">
3-
<class>aboutAutoSplitWidget</class>
4-
<widget class="QWidget" name="aboutAutoSplitWidget">
3+
<class>AboutAutoSplitWidget</class>
4+
<widget class="QWidget" name="AboutAutoSplitWidget">
55
<property name="geometry">
66
<rect>
77
<x>0</x>
@@ -34,7 +34,7 @@
3434
<iconset resource="resources.qrc">
3535
<normaloff>:/resources/icon.ico</normaloff>:/resources/icon.ico</iconset>
3636
</property>
37-
<widget class="QPushButton" name="okButton">
37+
<widget class="QPushButton" name="ok_button">
3838
<property name="geometry">
3939
<rect>
4040
<x>180</x>
@@ -47,7 +47,7 @@
4747
<string>OK</string>
4848
</property>
4949
</widget>
50-
<widget class="QLabel" name="createdbyLabel">
50+
<widget class="QLabel" name="created_by_label">
5151
<property name="geometry">
5252
<rect>
5353
<x>10</x>
@@ -60,7 +60,7 @@
6060
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Created by &lt;a href=&quot;https://twitter.com/toufool&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Toufool&lt;/span&gt;&lt;/a&gt; and &lt;a href=&quot;https://twitter.com/faschz&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Faschz&lt;/span&gt;&lt;/a&gt;&lt;br/&gt;Maintained by &lt;a href=&quot;https://twitter.com/Avasam06&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Avasam&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
6161
</property>
6262
</widget>
63-
<widget class="QLabel" name="versionLabel">
63+
<widget class="QLabel" name="version_label">
6464
<property name="geometry">
6565
<rect>
6666
<x>10</x>
@@ -73,7 +73,7 @@
7373
<string>Version: </string>
7474
</property>
7575
</widget>
76-
<widget class="QLabel" name="donatetextLabel">
76+
<widget class="QLabel" name="donate_text_label">
7777
<property name="geometry">
7878
<rect>
7979
<x>30</x>
@@ -90,7 +90,7 @@ consider donating. Thank you!</string>
9090
<set>Qt::AlignCenter</set>
9191
</property>
9292
</widget>
93-
<widget class="QLabel" name="donatebuttonLabel">
93+
<widget class="QLabel" name="donate_button_label">
9494
<property name="geometry">
9595
<rect>
9696
<x>60</x>
@@ -109,7 +109,7 @@ consider donating. Thank you!</string>
109109
<set>Qt::AlignCenter</set>
110110
</property>
111111
</widget>
112-
<widget class="QLabel" name="iconLabel">
112+
<widget class="QLabel" name="icon_label">
113113
<property name="geometry">
114114
<rect>
115115
<x>190</x>
@@ -131,9 +131,9 @@ consider donating. Thank you!</string>
131131
</resources>
132132
<connections>
133133
<connection>
134-
<sender>okButton</sender>
134+
<sender>ok_button</sender>
135135
<signal>clicked()</signal>
136-
<receiver>aboutAutoSplitWidget</receiver>
136+
<receiver>AboutAutoSplitWidget</receiver>
137137
<slot>close()</slot>
138138
<hints>
139139
<hint type="sourcelabel">

0 commit comments

Comments
 (0)