Skip to content

Commit

Permalink
Merge pull request #126 from Avasam/naming-convention
Browse files Browse the repository at this point in the history
Naming convention
  • Loading branch information
Toufool authored Dec 6, 2021
2 parents 0686ea4 + f0fa0e2 commit b2e4e2a
Show file tree
Hide file tree
Showing 23 changed files with 1,052 additions and 1,083 deletions.
17 changes: 8 additions & 9 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ color=always
max-line-length=120
; Auto generated
exclude=src/gen/
; TODO: We want to configure this
ignore=W503,N801,N802,N803,N806,N815,N816
per-file-ignores =
; imported but unused
; line too long
; mixed case
__init__.pyi:F401,E501,N816
; TODO: Bring WAY down
ignores=Y015
per-file-ignores=
; Quotes
__init__.pyi:Q000
; PyQt methods
ignore-names=closeEvent,paintEvent,keyPressEvent,mousePressEvent,mouseMoveEvent,mouseReleaseEvent
; TODO: Bring down to 15, same as SonarLint
max-complexity=55
inline-quotes = "
inline-quotes="
1 change: 1 addition & 0 deletions .github/workflows/lint-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
- master
- dev
- dev*
- 2.0.0
paths:
- '**.py'
- '**.pyi'
Expand Down
23 changes: 23 additions & 0 deletions PyInstaller/hooks/hook-cv2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE.GPL.txt, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
# https://github.com/pyinstaller/pyinstaller-hooks-contrib/blob/master/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-cv2.py

from PyInstaller.utils.hooks import collect_dynamic_libs, collect_data_files

hiddenimports = ["numpy"]

# Include any DLLs from site-packages/cv2 (opencv_videoio_ffmpeg*.dll can be found there in the PyPI version)
binaries = collect_dynamic_libs("cv2")

# https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/110
# OpenCV loader from 4.5.4.60 requires extra config files and modules
datas = collect_data_files("cv2", include_py_files=True, includes=["**/*.py"])
21 changes: 15 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ reportUnknownMemberType = "none"
# https://pylint.pycqa.org/en/latest/technical_reference/features.html
[tool.pylint.REPORTS]
# Just like default but any error will make drop to 9 or less
evaluation="10.0 - error - ((float(warning + refactor + convention) / statement) * 10)"
evaluation = "10.0 - error - ((float(warning + refactor + convention) / statement) * 10)"
[tool.pylint.MASTER]
fail-under=9.0
fail-under = 9.0
# https://pylint.pycqa.org/en/latest/technical_reference/extensions.html
load-plugins = [
"pylint.extensions.emptystring",
Expand Down Expand Up @@ -71,18 +71,27 @@ ignore-paths = [
"^src/gen/.*$",
]
# No need to mention the fixmes
disable=["fixme"]
disable = ["fixme"]
extension-pkg-allow-list = ["PyQt6", "win32ui"]

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

[tool.pylint.'MESSAGES CONTROL']
# Same as SonarLint
max-complexity = 15
max-branches = 15
# https://pylint.pycqa.org/en/latest/user_guide/options.html#naming-styles
module-naming-style = "any"
# Can't make private class with PascalCase
class-rgx = "_?_?[a-zA-Z]+?$"
good-names = [
# PyQt methods
"closeEvent", "paintEvent", "keyPressEvent", "mousePressEvent", "mouseMoveEvent", "mouseReleaseEvent",
# https://github.com/PyCQA/pylint/issues/2018
"x", "y", "a0", "i", "t0", "t1"]
disable = [
"missing-docstring",
# TODO: We want to configure this
# https://pylint.pycqa.org/en/latest/user_guide/options.html#naming-styles
"invalid-name",
# We group imports
"wrong-import-position",
# Already taken care of and grayed out. Also conflicts with Pylance reportIncompatibleMethodOverride
Expand Down
20 changes: 10 additions & 10 deletions res/about.ui
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>aboutAutoSplitWidget</class>
<widget class="QWidget" name="aboutAutoSplitWidget">
<class>AboutAutoSplitWidget</class>
<widget class="QWidget" name="AboutAutoSplitWidget">
<property name="geometry">
<rect>
<x>0</x>
Expand Down Expand Up @@ -34,7 +34,7 @@
<iconset resource="resources.qrc">
<normaloff>:/resources/icon.ico</normaloff>:/resources/icon.ico</iconset>
</property>
<widget class="QPushButton" name="okButton">
<widget class="QPushButton" name="ok_button">
<property name="geometry">
<rect>
<x>180</x>
Expand All @@ -47,7 +47,7 @@
<string>OK</string>
</property>
</widget>
<widget class="QLabel" name="createdbyLabel">
<widget class="QLabel" name="created_by_label">
<property name="geometry">
<rect>
<x>10</x>
Expand All @@ -60,7 +60,7 @@
<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>
</property>
</widget>
<widget class="QLabel" name="versionLabel">
<widget class="QLabel" name="version_label">
<property name="geometry">
<rect>
<x>10</x>
Expand All @@ -73,7 +73,7 @@
<string>Version: </string>
</property>
</widget>
<widget class="QLabel" name="donatetextLabel">
<widget class="QLabel" name="donate_text_label">
<property name="geometry">
<rect>
<x>30</x>
Expand All @@ -90,7 +90,7 @@ consider donating. Thank you!</string>
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="donatebuttonLabel">
<widget class="QLabel" name="donate_button_label">
<property name="geometry">
<rect>
<x>60</x>
Expand All @@ -109,7 +109,7 @@ consider donating. Thank you!</string>
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="iconLabel">
<widget class="QLabel" name="icon_label">
<property name="geometry">
<rect>
<x>190</x>
Expand All @@ -131,9 +131,9 @@ consider donating. Thank you!</string>
</resources>
<connections>
<connection>
<sender>okButton</sender>
<sender>ok_button</sender>
<signal>clicked()</signal>
<receiver>aboutAutoSplitWidget</receiver>
<receiver>AboutAutoSplitWidget</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
Expand Down
Loading

0 comments on commit b2e4e2a

Please sign in to comment.