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

Corrects several pylint warnings in sysfont module #1892

Merged
merged 1 commit into from Jun 4, 2020

Conversation

MyreMylar
Copy link
Contributor

@MyreMylar MyreMylar commented Jun 1, 2020

Initial Warnings before this PR

************* Module src_py.sysfont
src_py\sysfont.py:158:43: C0326: Exactly one space required after comma
			_addfont(_simplename(font_name),bold,italic,font_path,fonts)
										   ^ (bad-whitespace)
src_py\sysfont.py:158:48: C0326: Exactly one space required after comma
			_addfont(_simplename(font_name),bold,italic,font_path,fonts)
												^ (bad-whitespace)
src_py\sysfont.py:158:55: C0326: Exactly one space required after comma
			_addfont(_simplename(font_name),bold,italic,font_path,fonts)
													   ^ (bad-whitespace)
src_py\sysfont.py:158:65: C0326: Exactly one space required after comma
			_addfont(_simplename(font_name),bold,italic,font_path,fonts)
																 ^ (bad-whitespace)
src_py\sysfont.py:165:43: C0326: Exactly one space required after comma
		' '.join(['system_profiler', '-xml','SPFontsDataType']),
										   ^ (bad-whitespace)
src_py\sysfont.py:49:8: E0401: Unable to import '_winreg' (import-error)
src_py\sysfont.py:72:4: C0103: Variable name "TrueType_suffix" doesn't conform to snake_case naming style (invalid-name)
src_py\sysfont.py:125:12: C0103: Variable name "m" doesn't conform to snake_case naming style (invalid-name)
src_py\sysfont.py:67:0: R0912: Too many branches (14/12) (too-many-branches)
src_py\sysfont.py:164:11: W0612: Unused variable 'flerr' (unused-variable)
src_py\sysfont.py:212:11: W0703: Catching too general exception Exception (broad-except)
src_py\sysfont.py:238:11: W0703: Catching too general exception Exception (broad-except)
src_py\sysfont.py:234:19: W0703: Catching too general exception Exception (broad-except)
src_py\sysfont.py:216:4: R1702: Too many nested blocks (6/5) (too-many-nested-blocks)
src_py\sysfont.py:209:15: W0612: Unused variable 'flerr' (unused-variable)
src_py\sysfont.py:276:0: C0116: Missing function or method docstring (missing-function-docstring)
src_py\sysfont.py:290:0: C0116: Missing function or method docstring (missing-function-docstring)
src_py\sysfont.py:291:4: C0415: Import outside toplevel (pygame.font) (import-outside-toplevel)
src_py\sysfont.py:304:0: C0103: Function name "SysFont" doesn't conform to snake_case naming style (invalid-name)
src_py\sysfont.py:336:12: R1704: Redefining argument with the local name 'name' (redefined-argument-from-local)
src_py\sysfont.py:304:0: R0912: Too many branches (14/12) (too-many-branches)
src_py\sysfont.py:403:8: R1704: Redefining argument with the local name 'name' (redefined-argument-from-local)
src_py\sysfont.py:26:0: C0411: standard import "from os.path import basename, dirname, exists, join, splitext" should be placed before "from pygame.compat import xrange_, PY_MAJOR_VERSION" (wrong-import-order)

-----------------------------------
Your code has been rated at 8.76/10

Remaining Warnings after this PR

************* Module src_py.sysfont
src_py\sysfont.py:52:8: E0401: Unable to import '_winreg' (import-error)
src_py\sysfont.py:344:0: C0103: Function name "SysFont" doesn't conform to snake_case naming style (invalid-name)
src_py\sysfont.py:344:0: R0912: Too many branches (14/12) (too-many-branches)

------------------------------------------------------------------
Your code has been rated at 9.68/10 (previous run: 9.64/10, +0.05)

I don't think we can fix the first two, the first is for python 2 compatibility and changing the other one would break back compat.

The last one just didn't seem that bad to me, but you could probably squash it with a little fiddling.

Copy link
Member

@illume illume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@illume illume merged commit 3d1affb into pygame:master Jun 4, 2020
@MyreMylar MyreMylar deleted the pylint-sysfont branch June 5, 2020 16:41
@illume illume added Linters Related to code linting issues or solutions sysfont pygame.sysfont labels Sep 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linters Related to code linting issues or solutions sysfont pygame.sysfont
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants