Add --field option for post command
Review Request #8429 — Created Sept. 23, 2016 and submitted
This feature updates rbt post to allow for setting custom fields when
creating/updating a review request. It adds a new --field key=value
arguments, which would set extra_data.key=value in the payload. It
currently handles the native fields (description, testing_done,
summary) turning them into aliases of --description, --testing-done,
--summary. It also allows for multiple field arguments to be set
- added --field description="desc" to an rbt post
- Ensured that the field description contained "desc"
- Added multiple fields --field description="high level desc"
--field summary="short summary" to an rbt post - Ensured both argument fields were filled in correctly
- Added Unit tests
Description | From | Last Updated |
---|---|---|
Please include unit tests to ensure that rbt post --field foo=bar ends up with foo=bar sent as form data. |
brennie | |
Can you make sure to only use single quotes (unless you have a string with a single quote in it)? |
brennie | |
In your testing done: "high leveldesc" => "high level desc" |
brennie | |
Can you change your summary to be in the imperitive mood ("Add --field option ...."). Also "option" instead of "argument". |
brennie | |
Col: 80 E501 line too long (84 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (95 > 79 characters) |
reviewbot | |
fields would probably be a better name. |
brennie | |
Blank line between these. Also, can we call this key_value_pair? Python uses snake_case_names for variables. |
brennie | |
Can we include the offending value in the error message? |
brennie | |
Blank line between these. |
brennie | |
Blank line between these. |
brennie | |
You will want to use six.iteritems(self.options.fields). |
brennie | |
Hm, I think there's an edgecase here. Suppose I'm trying to set the following field: --field myField="thisstring=has=equals=signs" Your split is … |
mike_conley | |
We might want to have a List of "reserved fields" for cases like this, and use that list instead of … |
mike_conley | |
undefined name 'parser' |
reviewbot | |
undefined name 'parser' |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 78 W292 no newline at end of file |
reviewbot | |
Can we call this create_parser and not have it parse the arguments? Having it set self.options and return the parser … |
brennie | |
This should have a docstring, which should have a one-line summary summarizing the purpose of the function, a description going … |
chipx86 | |
Alphabetical order, please. |
brennie | |
Imports should be in alphabetical order, but within their correct import group. There are 3 groups: 1) Python Standard Library … |
chipx86 | |
Proper capitilzation and punctuation. |
brennie | |
This should be in sentence form. I think it also needs a bit more details. As it is, the help … |
chipx86 | |
Blank line around blocks (like if, for, etc.). |
chipx86 | |
No blank line here. |
chipx86 | |
Please make this a constant on the class. |
brennie | |
This should be a tuple, and is better defined on the class (with a doc comment). |
chipx86 | |
Blank line between these. |
brennie | |
Blank line before for, but not after. |
chipx86 | |
I don't think we need to cast to a list here. If it turns out we do, these statements can … |
chipx86 | |
No blank line here. |
brennie | |
Blank line between these. |
brennie | |
We should use single quotes wherever possible. In Python, they're interchangeable with double quotes, but are "cleaner." |
chipx86 | |
Same comments about blank lines around if. |
chipx86 | |
No blank line here. |
brennie | |
This won't actually show the key/value pair. You'll want to use %-formatting, e.g.: raise CommandError( 'The --field argument be a … |
brennie | |
The first line doesn't seem relevant to the error. When crafting error messages, always try to be as user-friendly as … |
chipx86 | |
No blank line here. |
chipx86 | |
No blank line here. |
brennie | |
It can be confusing if both --field description=value and --description=value is set. I think instead of transparently converting these, maybe … |
chipx86 | |
Blank line between these. |
chipx86 | |
Blank line between these. Also need a file docstring. |
brennie | |
Alphabetize these. |
brennie | |
Should be in alphabetical order. This should be: from rbtools.commands import CommandError from rbtools.commands.post import Post from rbtools.utils.testbase import RBTestBase |
chipx86 | |
"RBTools Commands" |
brennie | |
Should be in sentence form (trailing period). We don't really call these "RBCommands," but we also don't want one giant … |
chipx86 | |
Unnecessary. |
brennie | |
Alignment issue. |
chipx86 | |
Make your lines as long as possible under 79 chars. |
brennie | |
No indentation here. Things should be flush with the beginning of """ for subsequent lines. You can also fit more … |
chipx86 | |
Unindent this so it is flush with the leading " |
brennie | |
['rbt', 'post'] |
brennie | |
Best just to set to ['rbt', 'post']. Same with ones below. |
chipx86 | |
Single quotes (here and throughout the rest of the file, except for """). |
chipx86 | |
Make your lines as long as possible under 79 chars. |
brennie | |
And here. |
brennie | |
When wrapping lines, it's better to do: self.assertDictEqual(post.options.fields, {...}) However, we're dealing with multi-line dictionaries here, and we should have … |
chipx86 | |
['rbt', 'post'] |
brennie | |
""" on first line. |
brennie | |
blank line between these. |
brennie | |
Col: 25 W503 line break before binary operator |
reviewbot | |
Maybe this should be structured as: if (key in self.reserved_fields): if (getattr(self.options, key)): raise... setattr(self.options, key, value) else: extra_fields[key] = … |
mike_conley | |
I'm confused... should we be setting the extra_data field here? Like, it looks like we're assuming that the structure we're … |
mike_conley | |
Also, I don't think we need this first comment - it's already provided on line 10. |
mike_conley | |
Col: 80 E501 line too long (81 > 79 characters) |
reviewbot | |
Is it possible to add one more test that checks the post_request case to make sure that the extra_data__ prefix … |
mike_conley | |
Probably better: extra_fields['extra_data.%s' % key] = value |
mike_conley | |
This should should be --field |
brennie | |
Args? Returns? Look at other docstrings for examples of the format. |
brennie | |
Capitlization and period. |
brennie | |
These are not necessarily provided by extensions. We shoudl also document the fact that description, testing_done and summary can be … |
brennie | |
You can do: key, value = key_value_pair |
brennie | |
How about: The "foo" field was provided by both --foo= and --field foo=. Please only provide one of these. (or … |
brennie | |
Blank line between these. |
brennie | |
Docstrings should be in the imperative mood ("Create and return" instead of "Creates and returns"). We're also working towards including … |
david | |
"from custom fields" is kind of confusing outside of the context of this particular change. Maybe "native fields that can … |
david | |
This should mention that custom fields get set into the review request's extra_data. |
david | |
If no fields are specified, what is self.options.fields? Is there a way to avoid this check and just loop over … |
david | |
There's an extra line here. |
david | |
This line can be removed. |
david | |
Hmm. Shouldn't this be using the extra_data.X keys? |
david | |
Should be "--field foo=bar" |
david | |
Should be "--field foo=bar --field desc=new" (instead of "--fields foo=bar -field desc=new". Wrapping is also off. |
david | |
Should be --field. |
david | |
--field |
david | |
Col: 37 E131 continuation line unaligned for hanging indent |
reviewbot | |
Col: 80 E501 line too long (82 > 79 characters) |
reviewbot | |
Col: 33 E131 continuation line unaligned for hanging indent |
reviewbot | |
I don't think you need the extra list() call in here (you can iterate over self.options.fields directly). |
david | |
You're always assigning self.options.extra_fields inside post_process_fields, so you shouldn't need this check. |
david | |
Dedent this. The ) should be aligned with the O in Option on the line below. |
brennie | |
So the flag for testing_done is --testing-done. Make sure that we use the flag names instead of field names in … |
brennie | |
Missing a file docstring. (This can be as simple as "Test for RBTools commands.") |
brennie | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 17 E124 closing bracket does not match visual indentation |
reviewbot | |
I feel like 'native' is not the correct word here. Perhaps built-in. |
brennie | |
Remove right paren here. |
brennie | |
Single quotes. |
brennie | |
--field |
brennie | |
Can you use --field here (for consistency) |
brennie | |
Can you use --field here? |
brennie | |
Space between the argument name and the type. |
david | |
We should always put the space at the end of the line instead of the front. If that means wrapping … |
david | |
Needs to be an absolute class path. |
chipx86 | |
This isn't a Python-provided module. It needs to go in a third-party import group (new group in-between the Python standard … |
chipx86 | |
The --field needs to have double backticks on both sides. |
chipx86 | |
Technically, it's "testing_done". Can you test with both variations? --field testing-done=... and --field testing_done=... ? |
chipx86 | |
No need for the else:. It's implied, because the if raises an exception. |
chipx86 | |
We're doing key.replace('-', '_') twice. Can we do it once and assign to a variable? |
david | |
This file will inevitabley get very long. Can you instead make this rbtools/commands/tests/test_post.py? You'll need a blank rbtools/commands/tests/__init__.py in order … |
chipx86 | |
This has to be done a lot. Some or all of this would be a good candidate for a utility … |
chipx86 | |
Should use assertEqual. It implies assertDictEqual when being passed dictionaries. Same below. |
chipx86 | |
Add a trailing comma. |
david | |
This will never be used without an instance, so @staticmethod isn't really useful. It's better convention to have this just … |
david | |
While this does create the parser, it does more than just that (since it sets up the whole command). It … |
david | |
This would be better formatted as: post = self.create_arg_parser([ 'description=testing', 'summary=native testing', 'testing-done=No tests', ]) |
david | |
list of unicode |
brennie | |
"built-in" over "native" |
brennie | |
Previous line. |
brennie | |
You can replace this all with: update_fields = self.options.extra_fields.copy() |
brennie | |
Missing a period. |
brennie | |
Missinga period. |
brennie | |
This is internal for tests, so it should be _create_post_command. |
brennie | |
How about: "Create an argument parser with the given extra fields" |
brennie | |
list of unicode |
brennie | |
Missing period. Should be key-value. How about elaborating a bit, e.g. A list of key-value pairs for the field argument. … |
brennie | |
"built-in" over "native" |
brennie | |
"built-in" over "native" |
brennie | |
"argument" |
brennie | |
'six' imported but unused |
reviewbot |
- Groups:
- Commit:
-
ebb63f77425a2f005931add5f3392afca5531a30c5ebe9b63b3bdce289428c79beb3fac77f335b41
- Diff:
-
Revision 2 (+26)
-
Tool: Pyflakes Processed Files: rbtools/commands/post.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py
- Commit:
-
c5ebe9b63b3bdce289428c79beb3fac77f335b41c6ec40f550575dc881f56d869243c3f5af27b577
- Diff:
-
Revision 3 (+34)
-
Tool: Pyflakes Processed Files: rbtools/commands/post.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py
- Commit:
-
c6ec40f550575dc881f56d869243c3f5af27b577b0a0c5b2bbe88a96d53cb5179b213a577174227d
- Diff:
-
Revision 4 (+40)
-
Tool: Pyflakes Processed Files: rbtools/commands/post.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py
-
-
Hm, I think there's an edgecase here.
Suppose I'm trying to set the following field:
--field myField="thisstring=has=equals=signs"
Your split is going to split up the value, we'll fail the length check on line 274.
Even if we didn't check the length, we'd have the other problem where we accidentally set
thisstring
as the value, since that'skey_value_pair[1]
.So I think what we want to do here is split, and make sure that the resulting string is >= 2. Then, I think we want to have the 0th element be the key, and the rest of the elements joined to be the value.
-
We might want to have a List of "reserved fields" for cases like this, and use that list instead of if'ing over each case separately.
- Change Summary:
-
added unit tests
- Commit:
-
b0a0c5b2bbe88a96d53cb5179b213a577174227d2bd4b8b750e931984ee0c2736b2acaa02845cf92
-
Tool: Pyflakes Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py
-
-
-
-
Tool: Pyflakes Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py
-
Just a couple of comments / questions.
-
I'm super unfamiliar with the six module, so maybe you can disregard this - but isn't the purpose of this module to allow cross compatibility between Python 2 and 3?
Do we really need this, or could we get away with using dictionary.iteritems().
-
It seems to me like all of these tests assume a happy case scenario. Should we also be concerned about scenarios where you encounter nonsensical key-value pairs? It looks like you're throwing a CommandError in post.py, so there should probably be a unit test for that.
- Summary:
-
[WIP] Added --field argument for post commandAdded --field argument for post command
- Commit:
-
d3a8109969d6fa92a8c11a964369b44ad6244b4934060e52b48031f253b5693cb0df34435f08cb87
-
Tool: Pyflakes Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py
-
-
Can we call this
create_parser
and not have it parse the arguments? Having it setself.options
and return the parser is kinda confusing.Also this needs a docstring.
-
-
-
-
-
-
-
-
This won't actually show the key/value pair. You'll want to use %-formatting, e.g.:
raise CommandError( 'The --field argument be a key-value pair as key=value; got "%s" instead.' % field )
-
-
-
-
-
-
-
-
-
-
-
-
-
-
This should have a docstring, which should have a one-line summary summarizing the purpose of the function, a description going into details, and documentation on the arguments and return values.
The RBTools codebase is old, so there are plenty of methods that aren't documented to the degree that they should be, but new code should follow the modern conventions.
Those are documented here: https://www.reviewboard.org/docs/codebase/dev/docs/writing-codebase-docs/
-
Imports should be in alphabetical order, but within their correct import group. There are 3 groups:
1) Python Standard Library modules (which is this current existing group).
2) Third-party modules (six
is one of these)
3) Project modules (rbtools.*
)There's a blank line between each, and
import ...
statements come beforefrom ...
imports in each group.There's a special group (group 0) that is the
from __future__ import ...
statements, which would be before all other groups. -
This should be in sentence form. I think it also needs a bit more details. As it is, the help text I think will only make sense to those who are already familiar with what this flag does.
I'd propose: "Sets custom fields (provided by extensions) on the review request."
The
metavar
can then document the format:metavar="FIELD_NAME=VALUE"
-
-
-
-
-
I don't think we need to cast to a
list
here. If it turns out we do, these statements can be combined. -
We should use single quotes wherever possible. In Python, they're interchangeable with double quotes, but are "cleaner."
-
-
The first line doesn't seem relevant to the error.
When crafting error messages, always try to be as user-friendly as possible. "Key value pair" and "key" are probably not phrases/terms to use, as they're more internal terminology. Instead, we can safely say "The --field argument should be in the form of: --field name=value"
-
-
It can be confusing if both
--field description=value
and--description=value
is set. I think instead of transparently converting these, maybe we want to just tell the user to use e.g.--description
instead. -
-
Should be in alphabetical order. This should be:
from rbtools.commands import CommandError from rbtools.commands.post import Post from rbtools.utils.testbase import RBTestBase
-
Should be in sentence form (trailing period).
We don't really call these "RBCommands," but we also don't want one giant class for all commands. Instead, let's have a class per command. So this can be
class PostCommandTests
, and the description can referencerbt post
. -
-
No indentation here. Things should be flush with the beginning of
"""
for subsequent lines. You can also fit more on the first line here.Each one of these should also mention "rbt post," like:
"""Testing rbt post with <condition>"""
When a docstring can fit on one line, put the final
"""
on the same line.These all apply below.
-
-
-
When wrapping lines, it's better to do:
self.assertDictEqual(post.options.fields, {...})
However, we're dealing with multi-line dictionaries here, and we should have one entry per line for readability/maintainability. We also want to keep things at nice 4-space indentation levels. So use this form instead:
self.assertDictEqual( post.options.fields, { 'foo': 'bar', 'desc': 'new', })
Note also the trailing comma on the last entry in the dictionary. We want these for dictionaries, lists, tuples, etc. so that future updates can simply add a line and not modify the previous to add a comma.
- Testing Done:
-
- added --field description="desc" to an rbt post
- Ensured that the field description contained "desc"
- Added multiple fields --field description="high leveldesc"
--field summary="short summary" to an rbt post
- Ensured both argument fields were filled in correctly
+ - Added Unit tests
- Commit:
-
3178e1e875bf30b514fd3c339cf932ffc7953356cfeb2d65d5075d5ffd2a0dc59bf825b51da14e78
-
Tool: Pyflakes Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py
-
-
You might want to double-check with chipx86, david or brennie, but I'm not sure "native" is the right word here. Maybe built-in?
-
So the rule is, we can set these built-in/native fields iff they haven't already been set?
I just want to make sure that's explicit and desired.
-
Maybe this should be structured as:
if (key in self.reserved_fields): if (getattr(self.options, key)): raise... setattr(self.options, key, value) else: extra_fields[key] = value
This helps reduce some duplication.
-
I'm confused... should we be setting the
extra_data
field here? Like, it looks like we're assuming that the structure we're updating is like:# For --field foo="bar" { 'target_groups': [], 'target_people': [], 'foo': "bar", }
When I think it's supposed to be:
# For --field foo="bar" { 'target_groups': [], 'target_people': [], 'extra_data__foo': "bar", }
See https://github.com/reviewboard/rbtools/commit/e35445f43ef97cc7fb358d09c5d0d72a19f83904 for details.
-
Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py Tool: Pyflakes Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py
-
Tool: Pyflakes Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py
-
Tool: Pyflakes Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py
-
Tool: Pyflakes Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py
- Change Summary:
-
Fixed Barret's comments on the doc and error strings
- Testing Done:
-
- added --field description="desc" to an rbt post
- Ensured that the field description contained "desc"
~ - Added multiple fields --field description="high leveldesc"
--field summary="short summary" to an rbt post
~ - Added multiple fields --field description="high level desc"
--field summary="short summary" to an rbt post
- Ensured both argument fields were filled in correctly
- Added Unit tests
- Commit:
-
fca63baaed3ce888aecb39d447b075bccc68e8e1371175aa7798e032a3eebe049a5b627fa01ae3dd
-
Tool: Pyflakes Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py
-
I don't see anything in your testing about actually testing custom fields (it looks like you just tested with the description). Can you run it with a custom field name and verify in the devserver's database that it set the extra_data correctly?
-
Docstrings should be in the imperative mood ("Create and return" instead of "Creates and returns").
We're also working towards including more detailed information about function arguments, return values, etc. See https://www.reviewboard.org/docs/codebase/dev/docs/writing-codebase-docs/#special-sections (you'll need "Args" and "Returns" sections here).
-
"from custom fields" is kind of confusing outside of the context of this particular change. Maybe "native fields that can be set using the --field argument"?
-
-
If no fields are specified, what is
self.options.fields
? Is there a way to avoid this check and just loop over a potentially empty list in order to avoid the extra level of indentation? -
-
-
-
-
Should be "--field foo=bar --field desc=new" (instead of "--fields foo=bar -field desc=new". Wrapping is also off.
-
-
- Change Summary:
-
refactoring doc strings and help message
- Commit:
-
371175aa7798e032a3eebe049a5b627fa01ae3dd5842cc3b37343dc6a168aab721a83581e5dbcff8
-
Tool: Pyflakes Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py
- Change Summary:
-
refactored extra_fields to a seperate dictionary
- Commit:
-
5842cc3b37343dc6a168aab721a83581e5dbcff855e5b03144b7b2ac6c5ac83c21cfda2911f4aa07
-
Tool: Pyflakes Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py
-
-
- Change Summary:
-
review bot issue fixes
- Commit:
-
55e5b03144b7b2ac6c5ac83c21cfda2911f4aa077800a261eeb18f6b3d6605abe0bad4185dab6454
-
Tool: Pyflakes Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py
- Change Summary:
-
fixing conditional indentation
- Commit:
-
7800a261eeb18f6b3d6605abe0bad4185dab645438cdf9d91f396341dadd108742735490428432bc
- Change Summary:
-
bot issue on line indentation
- Commit:
-
38cdf9d91f396341dadd108742735490428432bc4098cb668a14ef788e0bc97c57b712cdd04e8561
-
Tool: Pyflakes Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py
- Change Summary:
-
fixing review issues
- Commit:
-
4098cb668a14ef788e0bc97c57b712cdd04e85616ea8c9876c3f8cd1d7fab550d1e1d55150d5d56f
-
Tool: Pyflakes Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py
- Change Summary:
-
fixing Barret's issues on docstring
- Summary:
-
Added --field argument for post commandAdd --field option for post command
- Commit:
-
6ea8c9876c3f8cd1d7fab550d1e1d55150d5d56f611fd66a78f6cbd8923a881d87a7e0a80e249c25
- Change Summary:
-
fixing review bot line too long issue
- Commit:
-
05769c10607f6abb06b42469b4a436aba5341dd719546b1d675c6f3be04c4a9cdf64b2da67b0bbc1
-
Tool: Pyflakes Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py
- Change Summary:
-
fixed doc string issues
- Commit:
-
19546b1d675c6f3be04c4a9cdf64b2da67b0bbc1ceb61cac832809d83a327d944452faf5999cc779
-
Tool: Pyflakes Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py
- Change Summary:
-
fixed issues with function doc string and help message of field option
- Commit:
-
ceb61cac832809d83a327d944452faf5999cc779b2f282ac237ebe316938d5591917ef6e77e0003f
-
Tool: Pyflakes Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/post.py rbtools/commands/tests.py rbtools/commands/__init__.py
-
-
-
This isn't a Python-provided module. It needs to go in a third-party import group (new group in-between the Python standard library imports and the rbtools imports).
-
-
Technically, it's "testing_done". Can you test with both variations?
--field testing-done=...
and--field testing_done=...
? -
-
This file will inevitabley get very long. Can you instead make this
rbtools/commands/tests/test_post.py
?You'll need a blank
rbtools/commands/tests/__init__.py
in order to make this a module. -
This has to be done a lot. Some or all of this would be a good candidate for a utility function on this test class.
-
- Change Summary:
-
fixing issues with test code refactor
- Commit:
-
b2f282ac237ebe316938d5591917ef6e77e0003f3bec4a17587c3ba25fd421fa12192b0385d86692
-
Tool: Pyflakes Processed Files: rbtools/commands/tests/test_post.py rbtools/commands/post.py rbtools/commands/__init__.py Ignored Files: rbtools/commands/tests/__init__.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/tests/test_post.py rbtools/commands/post.py rbtools/commands/__init__.py Ignored Files: rbtools/commands/tests/__init__.py
-
-
This will never be used without an instance, so
@staticmethod
isn't really useful. It's better convention to have this just be an instance method that takes an unusedself
parameter. -
While this does create the parser, it does more than just that (since it sets up the whole command). It might be better to name this something like
create_post_command
. -
This would be better formatted as:
post = self.create_arg_parser([ 'description=testing', 'summary=native testing', 'testing-done=No tests', ])
- Change Summary:
-
minor issue fixes
- Commit:
-
3bec4a17587c3ba25fd421fa12192b0385d86692911593eee00d598d0d74796dfe89a159adbab1b2
-
Tool: Pyflakes Processed Files: rbtools/commands/tests/test_post.py rbtools/commands/post.py rbtools/commands/__init__.py Ignored Files: rbtools/commands/tests/__init__.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/tests/test_post.py rbtools/commands/post.py rbtools/commands/__init__.py Ignored Files: rbtools/commands/tests/__init__.py
-
I'm happy with this. I'm going to try to get another mentor to give it a last glance to make sure there's nothing I missed.
- Change Summary:
-
fixing issues with test file, doc strings and function naming
- Commit:
-
911593eee00d598d0d74796dfe89a159adbab1b254b1953afdfc5be406fabbe8f283a12b919dac41
-
Tool: Pyflakes Processed Files: rbtools/commands/tests/test_post.py rbtools/commands/post.py rbtools/commands/__init__.py Ignored Files: rbtools/commands/tests/__init__.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/tests/test_post.py rbtools/commands/post.py rbtools/commands/__init__.py Ignored Files: rbtools/commands/tests/__init__.py
-
- Change Summary:
-
rb bot fix
- Commit:
-
54b1953afdfc5be406fabbe8f283a12b919dac41ff8c0c6d12b41b1f16f53eb2168acd42b1ee1afb
-
Tool: Pyflakes Processed Files: rbtools/commands/tests/test_post.py rbtools/commands/post.py rbtools/commands/__init__.py Ignored Files: rbtools/commands/tests/__init__.py Tool: PEP8 Style Checker Processed Files: rbtools/commands/tests/test_post.py rbtools/commands/post.py rbtools/commands/__init__.py Ignored Files: rbtools/commands/tests/__init__.py