flake8
-
reviewboard/diffviewer/models/diff_commit.py (Diff revision 1) Show all issues -
Review Request #9609 — Created Feb. 9, 2018 and submitted
Information | |
---|---|
brennie | |
Review Board | |
release-4.0.x | |
|
|
9631 | |
b8f56a6... | |
Reviewers | |
reviewboard | |
This is the first of a series of commits to introduce support for commit
series review. This patch adds the necessary database model
(DiffCommit
) and updates the existing models to introduce
relationships.
Ran unit tests.
Applied evolution.
Description | From | Last Updated |
---|---|---|
F821 undefined name 'text' |
![]() |
|
E303 too many blank lines (2) |
![]() |
|
W292 no newline at end of file |
![]() |
|
Git commits currently use a 40-character hash, but I'm not sure that's future proof, or even current proof for other … |
|
|
E303 too many blank lines (4) |
![]() |
|
E303 too many blank lines (2) |
![]() |
|
Two blank lines here. |
|
|
Can you add doc comments for any of these meant to be public, and prefix any that aren't with a … |
|
|
This might be useful to put in a validators.py. |
|
|
These should also have blank=True. |
|
|
This should describe how the result would look, since it differs based on provided data (and may be None). |
|
|
Same here. |
|
|
Probably worth mentioning in this about the truncation. ... do we want truncation? I almost feel like if we do, … |
|
|
This doesn't mention that it may be None. |
|
|
Worth mentioning, email.utils.formataddr has basically the same logic, with the difference being that an empty e-mail will be in the … |
|
|
F401 'reviewboard.diffviewer.validators.COMMIT_ID_RE' imported but unused |
![]() |
|
Needs to be one line. These don't need (and probably shouldn't have) literals in the summary. Just say "The maximum … |
|
|
Now that we have summary_truncated, how about getting rid of truncation from summary? |
|
|
I see the need to split this out, but I'm wondering whether this is the right name. How about something … |
|
|
Backtick should be removed. |
|
|
This should specify when it might be None. |
|
|
Missing a docstring. |
|
|
Do we want > 80 or >= 80? |
|
|
This won't link anymore. Needs to be the full path. |
|
|
Why's this removed? |
|
|
Kinda feel like this really should be "commit_count." We also have a "commit" field, and a "file_count," and we should … |
|
|
Should be single quotes. |
|
|
Too many "f"s in "mixin". Also typo in "collection." |
|
reviewboard/diffviewer/models/diff_commit.py (Diff revision 1) |
---|
pep8
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+247 -4) |
Refactored out
get_total_line_counts
into a mixin for inclusion inDiffCommit
.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+287 -31) |
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 4 (+287 -31) |
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 5 (+287 -31) |
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 6 (+288 -31) |
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 7 (+286 -31) |
reviewboard/diffviewer/models/diff_commit.py (Diff revision 5) |
---|
Git commits currently use a 40-character hash, but I'm not sure that's future proof, or even current proof for other VCSes. Can we increase the max?
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 8 (+287 -31) |
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 9 (+286 -31) |
reviewboard/diffviewer/models/diff_commit.py (Diff revision 9) |
---|
Can you add doc comments for any of these meant to be public, and prefix any that aren't with a
_
?
reviewboard/diffviewer/models/diff_commit.py (Diff revision 9) |
---|
This might be useful to put in a
validators.py
.
reviewboard/diffviewer/models/diff_commit.py (Diff revision 9) |
---|
This should describe how the result would look, since it differs based on provided data (and may be
None
).
reviewboard/diffviewer/models/diff_commit.py (Diff revision 9) |
---|
Probably worth mentioning in this about the truncation.
... do we want truncation? I almost feel like if we do, it should be its own property.
reviewboard/diffviewer/models/diff_commit.py (Diff revision 9) |
---|
This doesn't mention that it may be
None
.
reviewboard/diffviewer/models/diff_commit.py (Diff revision 9) |
---|
Worth mentioning,
email.utils.formataddr
has basically the same logic, with the difference being that an empty e-mail will be in the form ofname <>
. Still, maybe we want to use that instead.
Addressed open issues.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 10 (+309 -31) |
reviewboard/diffviewer/models/diff_commit.py (Diff revision 10) |
---|
F401 'reviewboard.diffviewer.validators.COMMIT_ID_RE' imported but unused
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 11 (+328 -31) |
reviewboard/diffviewer/models/diff_commit.py (Diff revision 11) |
---|
Needs to be one line.
These don't need (and probably shouldn't have) literals in the summary. Just say "The maximum length of the e-mail address fields" here, and similar above.
reviewboard/diffviewer/models/diff_commit.py (Diff revision 11) |
---|
Now that we have
summary_truncated
, how about getting rid of truncation fromsummary
?
reviewboard/diffviewer/models/mixins.py (Diff revision 11) |
---|
I see the need to split this out, but I'm wondering whether this is the right name. How about something like
FileDiffCollectionMixin
? We're really talking about something that provides operations for objects that manage filediffs. I could see us expanding this down the road.In fact, since we're modifying
DiffSet
anyway, one immediately useful thing I can think of is aRelationCounterField
for the files, so that logic doesn't have to query for file countds.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 12 (+334 -32) |
Fix unit test failures.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 13 (+334 -32) |
Actually commit changes.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 14 (+334 -33) |
reviewboard/diffviewer/models/diff_commit.py (Diff revision 14) |
---|
This should specify when it might be None.
reviewboard/diffviewer/models/mixins.py (Diff revision 14) |
---|
This won't link anymore. Needs to be the full path.
Addressed Christian's feedback
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 15 (+339 -33) |
Rename description -> commit_message from feedback on /r/9642/
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 16 (+339 -33) |
In preparation for a change that re-standardizes us on
diffset
overdiff_set
.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 17 (+339 -33) |
reviewboard/diffviewer/evolutions/diff_commit_relations.py (Diff revisions 16 - 17) |
---|
Kinda feel like this really should be "commit_count." We also have a "commit" field, and a "file_count," and we should be consistent.
Addressed Christian's feedback.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 18 (+339 -33) |
Depends On: |
|
||||
---|---|---|---|---|---|
Commit: |
|
||||
Diff: |
Revision 19 (+326 -33) |
reviewboard/diffviewer/models/mixins.py (Diff revision 19) |
---|
Too many "f"s in "mixin".
Also typo in "collection."
Re-add missing evolution
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 20 (+340 -33) |