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

Pylint fixes for py_draw.py #1936

Merged
merged 1 commit into from Jun 14, 2020
Merged

Pylint fixes for py_draw.py #1936

merged 1 commit into from Jun 14, 2020

Conversation

MyreMylar
Copy link
Contributor

As far as I can tell this module is used exclusively for testing the real draw functions in draw.c. As such I was a little more ruthless in linting and tried to maintain only the function interfaces that were equivalent to the draw.c functions.

The other problem with it is that there are lots of TODOs all over it that I didn't really want to get into. I feel like linting errors and fixing TODOs are two entirely different things that shouldn't really be jumbled together, as such I ran pylint with fixme disabled for this file.

Disabled alerts:

  • Only one this time:
def _multi_lines(surf, color, closed,  # pylint: disable=too-many-arguments
                 points, width=1, blend=False,
                 aaline=False):

This function is used to implement the interfaces of both draw_line() and draw_aaline() two functions that are already right at pylint's limit for function arguments, thus it wasn't really possible to cut the fat without splitting it into two functions - which would remove the point of having it all in one shared function in the first place.

Remaining warnings after this PR (with fixme disabled)

0

Tested using:

pylint src_py/draw_py.py --extension-pkg-whitelist=pygame --disable=fixme

@illume illume closed this Jun 10, 2020
@illume illume reopened this Jun 10, 2020
@illume
Copy link
Member

illume commented Jun 14, 2020

Yeah, this module was supposed to be a python implementation of the drawing algorithms.

  • comparison testing with different implementations
  • debugging, and implementing new algos is easier with python
  • useful for teaching.
  • perhaps very fast when JIT compiled on things like pypy

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.

👍

@MyreMylar MyreMylar merged commit 4562396 into pygame:master Jun 14, 2020
@MyreMylar MyreMylar deleted the pylint-draw branch September 11, 2020 15:19
@illume illume added draw pygame.draw Linters Related to code linting issues or solutions labels Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
draw pygame.draw Linters Related to code linting issues or solutions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants