Skip to content

Fix Pylint violations (easy) - #7013

Merged
sarina merged 16 commits into
openedx:masterfrom
stvstnfrd:pylint/low
Feb 20, 2015
Merged

Fix Pylint violations (easy)#7013
sarina merged 16 commits into
openedx:masterfrom
stvstnfrd:pylint/low

Conversation

@stvstnfrd

Copy link
Copy Markdown
Contributor

This is a subset to partially replace #7008.

@sarina You were right; piecemeal is the way to go here.

This set should be pretty easy to review; most of these are self-evident without context (the fun comes later).

@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @stvstnfrd! I've created OSPR-412 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams.

Feel free to add as much of the following information to the ticket:

  • supporting documentation
  • edx-code email threads
  • timeline information ('this must be merged by XX date', and why that is)
  • partner information ('this is a course on edx.org')
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will still be done via the Github pull request interface. As a reminder, our process documentation is here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are we certain that nothing relies on depth as a positional argument?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My extensive grepping reveals no matches.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I found this hard to believe at first, but looking at the function signature for other definitions of get_courses, (self, **kwargs) seems to actually match what we already have elsewhere.

@singingwolfboy

Copy link
Copy Markdown
Contributor

👍

Also, it looks like the Jenkins build only failed because of the newly-exposed pylint violations, which were actually there the whole time. For example, empty docstrings are worse than no docstrings at all, but pylint didn't catch the empty docstrings. I think this PR is ready to merge, despite the Jenkins "failure".

@stvstnfrd

Copy link
Copy Markdown
Contributor Author

@singingwolfboy Yeah, it looks like the only "failures" are from 4
diff-quality warnings (pylint) [1]:

  • 3 are for missing-docstring
  • 1 is for an invalid-name (too short)

Each of these issues was already present; they're just being exposed to
diff-quality because the lines are being updated.

The invalid-name I've already fixed in a separate branch. The
missing-docstring is an issue throughout our codebase; it's the
single largest violation, representing ~20% of all Pylint violations.

But to re-emphasize, these issues already existed in the code, so I'd
prefer to not rabbit-hole further for now; please advise.

[1] https://build.testeng.edx.org/job/edx-platform-all-tests-pr/1773/SHARD=1,TEST_SUITE=quality,label_exp=jenkins-worker/artifact/reports/diff_quality/diff_quality_pylint.html

@sarina

sarina commented Feb 18, 2015

Copy link
Copy Markdown
Contributor

@stvstnfrd generally I think I agree, that it's fine to merge this without a fully-passing build. Let me take a shot at reviewing this first.

@sarina

sarina commented Feb 18, 2015

Copy link
Copy Markdown
Contributor

@stvstnfrd this drops us to 6044 pylint violations. Personally I think it'd be best to adjust the PYLINT_THRESHOLD as we merge changes in, but if you disagree I'm open to a different approach.

@stvstnfrd

Copy link
Copy Markdown
Contributor Author

@sarina I agree; allow me to tack on an additional commit to drop the threshold.

@stvstnfrd

Copy link
Copy Markdown
Contributor Author

I have added an additional commit to lower the threshold at 0e997c7.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we move this comment to above L12, so we understand why we need the pragma?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

durrrhh nevermind realized L12 is actually a removal not an addition n/m

@sarina

sarina commented Feb 19, 2015

Copy link
Copy Markdown
Contributor

👍 once last 2 comments addressed.

@stvstnfrd

Copy link
Copy Markdown
Contributor Author

@sarina I have removed the useless test and added a TODO comment about fixing the other test later.

@sarina

sarina commented Feb 20, 2015

Copy link
Copy Markdown
Contributor

Huh - it doesn't seem like the build is actually running. I wonder if you're lacking some of the infrastructure to make our recent Jenkins upgrades run properly. I'm going to cancel the build, and if you could rebase this, we'll see if that gets the build going properly.

Per @sarina:
> `build_problem` is called in `_make_problem`, which other tests call
> in this class. A failure here will arise in other tests. This test is
> unnecessary.
@sarina

sarina commented Feb 20, 2015

Copy link
Copy Markdown
Contributor

I'm working with test eng to get the build stuff straightened out - it's not running properly, not your fault at all. Will merge as soon as I can get it all figured out.

@sarina

sarina commented Feb 20, 2015

Copy link
Copy Markdown
Contributor

test this please

@stvstnfrd

Copy link
Copy Markdown
Contributor Author

No worries; let me know how I can help.

@sarina

sarina commented Feb 20, 2015

Copy link
Copy Markdown
Contributor

test this please

@sarina

sarina commented Feb 20, 2015

Copy link
Copy Markdown
Contributor

ok to test

@sarina

sarina commented Feb 20, 2015

Copy link
Copy Markdown
Contributor

Alright the failing tests on this branch are flaky and I believe are already disabled in master. Plus they passed on the lbuild I ran on my identical branch (#7049).

sarina added a commit that referenced this pull request Feb 20, 2015
@sarina
sarina merged commit 6900bd2 into openedx:master Feb 20, 2015
@stvstnfrd
stvstnfrd deleted the pylint/low branch February 20, 2015 21:57
@stvstnfrd

Copy link
Copy Markdown
Contributor Author

w00t! I'll try to assemble another set this weekend!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants