flake8
-
bot/reviewbot/tools/nyc.py (Diff revision 1) Show all issues -
-
Review Request #10195 — Created Oct. 4, 2018 and updated
Information | |
---|---|
alextechcc | |
ReviewBot | |
master | |
|
|
73a2f5f... | |
Reviewers | |
reviewbot, students | |
Integration with ReviewBot has been added for the
nyc
code coverage
tool.This tool can be configured to run on most JavaScript setups by
providing a list of install steps and test command in the integration
configuration.It utilizes the 'json-summary' backend to provide basic per-file
thresholds and opens issues on files that do not meet these thresholds.Documentation has been added for this tool.
Tool has been tested with a basic JavaScript test repository with
multiple thresholds, usingnpm
andjasmine-node
. Other frameworks
have had basic testing done.
Description | From | Last Updated |
---|---|---|
In Description, there is a typo 'utalizes' and ReviewBot should be Review Bot |
|
|
Typo in description: 'utalizes' |
|
|
F841 local variable 'fp' is assigned to but never used |
![]() |
|
F821 undefined name 'f' |
![]() |
|
E265 block comment should start with '# ' |
![]() |
|
Nit: blank line between these. |
|
|
This doesn't need to be in the with block. |
|
|
Does nyc work on JSX (.jsx)? Does it work on TypeScript .ts/.tsx? |
|
|
a |
|
|
You will want to use the os.path module here. / is not guaranteed to be the path separator on every … |
|
|
Can we pass in cwd from the parent method? If there are lots of files, that is a lot of … |
|
|
You do not need to append the path sep. That is what os.path.join is for. |
|
|
os.path.join(t) is just t. You don't need it. |
|
|
In what case does f.get_patched_file_path() return None ? |
|
|
Comments should be full sentences, i.e., they should begin with a capital letter and end with a period. |
|
|
If you're using the first_line logic you added in your other patch, you'll want to mark this review request as … |
|
|
Missing a period. |
|
|
What if there are quoted substrings? This should use shlex.split(). |
|
|
Let's call this either i or index. |
|
|
Missing period. |
|
|
Remove this blank line. |
|
|
Needs a period. |
|
|
Blank line between these. |
|
|
Blank line between these. |
|
|
Missing a period. |
|
|
``istanbul`` |
|
|
``npm`` |
|
|
:file:`package.json` |
|
|
``nodejs`` |
|
|
:file:`package.json` ``test`` |
|
|
``nodejs`` |
|
|
This should be a rst link. It is missing a period. |
|
|
Should be listed alphabetically? |
|
|
test suite instead of test-suite to be consistent |
|
|
Parentheses are not needed here. |
|
|
Parentheses are not needed here. |
|
|
Should probably mention for what language(s) it does code coverage. Also since the actual name of the tool is Istanbul … |
|
|
Should probably mention for what language(s) it does code coverage. |
|
|
how about %s: %s%% coverage less than minimum threshold (%s%%) just to make it clear that its about coverage |
|
|
Same comments here about Istanbul vs nyc. |
|
|
Here too |
|
bot/reviewbot/tools/nyc.py (Diff revision 1) |
---|
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+144) |
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+141) |
bot/reviewbot/tools/nyc.py (Diff revision 3) |
---|
Does
nyc
work on JSX (.jsx
)? Does it work on TypeScript.ts
/.tsx
?
bot/reviewbot/tools/nyc.py (Diff revision 3) |
---|
You will want to use the
os.path
module here./
is not guaranteed to be the path separator on every platform. Technically you could run the reviewbot worker on Windows if you needed to run a Windows-only tool.import os # ... file_coverage = coverage[os.path.join(os.getcwd(), path)]
bot/reviewbot/tools/nyc.py (Diff revision 3) |
---|
Can we pass in
cwd
from the parent method? If there are lots of files, that is a lot of calls toos.getcwd()
, which isn't going to change.
Less spam by combining per-file messages. Code nitpick cleanup, only consider files that
nyc
actually tested.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 4 (+25 -13) |
bot/reviewbot/tools/nyc.py (Diff revision 4) |
---|
You do not need to append the path sep. That is what
os.path.join
is for.
bot/reviewbot/tools/nyc.py (Diff revision 4) |
---|
In what case does
f.get_patched_file_path()
returnNone
?
bot/reviewbot/tools/nyc.py (Diff revision 4) |
---|
Comments should be full sentences, i.e., they should begin with a capital letter and end with a period.
bot/reviewbot/tools/nyc.py (Diff revision 4) |
---|
If you're using the first_line logic you added in your other patch, you'll want to mark this review request as depending on the other.
Depends on whole-file fix
Depends On: |
|
---|
Rebased on 10095 (Add ability for bots to make general comments)
Depends On: |
|
||||
---|---|---|---|---|---|
Commit: |
|
||||
Diff: |
Revision 5 (+165) |
Added documentation, only comment if there are issues and the file in question is modified, much nicer comments that explain issue, added config section to manually implant a .nycrc.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 6 (+248) |
Big cleanup, removed dependency on being run in an
npm
environment, updated documentation. NOTE: some debug print statements, ignore those
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 7 (+273) |
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 8 (+271) |
bot/reviewbot/tools/nyc.py (Diff revision 8) |
---|
Do we want to just pass this as a file (or input) to
/bin/sh
?
bot/reviewbot/tools/nyc.py (Diff revision 8) |
---|
What if there are quoted substrings? This should use
shlex.split()
.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 9 (+272) |
Removed WIP tag, updated description fields.
Summary: |
|
||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
||||||||||||||||||||||||||||||||||||
Testing Done: |
|
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 10 (+275) |
README.rst (Diff revision 10) |
---|
Should probably mention for what language(s) it does code coverage.
Also since the actual name of the tool is Istanbul (whereas nyc is just the cli) should this be something like:
Istanbul (nyc)
bot/README.rst (Diff revision 10) |
---|
Should probably mention for what language(s) it does code coverage.
bot/reviewbot/tools/nyc.py (Diff revision 10) |
---|
how about
%s: %s%% coverage less than minimum threshold (%s%%)
just to make it clear that its about coverage
Description: |
|
||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commit: |
|
||||||||||||||||||||||||||||||||||||
Diff: |
Revision 11 (+275) |