Various pylint fixes for arg.py
ClosedPublic

Authored by demon on Nov 17 2017, 4:47 PM.

Details

Reviewers
mmodell
thcipriani
Group Reviewers
Release-Engineering-Team
Commits
rMSCA96216732cc71: Various pylint fixes for arg.py
Patch without arc
git checkout -b D887 && curl -L https://phabricator.wikimedia.org/D887?download=true | git apply
Summary
  • Make a few variable names more descriptive
  • Don't check if a parameter is a py2-style file. In addition to being basically impossible, it won't even work on py3
  • Simplify not equal logic in once place
  • Drop some unused local variables in favor of inlining the logic
  • Add some docs

Diff Detail

Repository
rMSCA Scap
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
demon created this revision.Nov 17 2017, 4:47 PM
Restricted Application added a reviewer: mmodell. · View Herald TranscriptNov 17 2017, 4:47 PM
Restricted Application added a reviewer: Release-Engineering-Team. · View Herald Transcript
Restricted Application added a project: Release-Engineering-Team. · View Herald Transcript
demon updated this revision to Diff 2338.Nov 17 2017, 4:49 PM
  • Fix line too long
demon requested review of this revision.Nov 17 2017, 4:51 PM
demon updated this revision to Diff 2340.Nov 17 2017, 5:03 PM
  • Finish inlining all the arguments to _ScapAutoCompleteAction
thcipriani accepted this revision.Nov 17 2017, 6:11 PM
thcipriani added a subscriber: thcipriani.

Seems to work just fine, added a few thoughts inline.

Removed a few variables I thought made the code a little easier to read (and we need all the help we can get in this strange little section :)).

scap/arg.py
60

Makes me twitchy to change the initialization interface while subclassing, but I suppose it's not critical in this instance. Probably doesn't matter.

328

makes it somewhat ambiguous what this is doing, variable was self-documenting, maybe needs a comment now.

347

self-documenting variable name removal

This revision is now accepted and ready to land.Nov 17 2017, 6:11 PM
demon marked 2 inline comments as done.Nov 17 2017, 6:15 PM
demon updated this revision to Diff 2342.Nov 17 2017, 6:18 PM
  • - Restore self-documenting variables
demon added inline comments.Nov 17 2017, 6:20 PM
scap/arg.py
60

I prefer having constructors be as narrowly defined as possible for the given use case. It's one of the reasons I like that Java supports multiple constructors.

This revision was automatically updated to reflect the committed changes.