Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions st_package_reviewer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Review Sublime Text packages.
"""
"""Review Sublime Text packages."""

__version__ = "0.2.2"

Expand Down
4 changes: 2 additions & 2 deletions st_package_reviewer/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def _prepare_nargs(nargs):


def main():
"""\
"""Main.
Copy link
Member

Choose a reason for hiding this comment

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

This docstring is later used to generate the help message, which is sub-optimal but works. Your change introduced a random "Main." in the help message.


Return values:
0: No errors
-1: Invalid command line arguments
Expand All @@ -54,7 +55,6 @@ def main():
Enter package paths or repository URLS continuously.
Type `c` to copy the last report to your clipboard.
"""

parser = argparse.ArgumentParser(prog=__package__,
description="Check a Sublime Text package for common errors.",
epilog=textwrap.dedent(main.__doc__),
Expand Down
9 changes: 6 additions & 3 deletions tests/test_file_checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def test_reviewer_integration(package_path, check_runner):
If all failures or warnings should be compared,
specify them in "all_failures" and "all_warnings".
"""

# Run checks first and report them to stdout,
# so we have something to inspect when the test fails.
check_runner.run(package_path)
Expand All @@ -99,8 +98,12 @@ def test_reviewer_integration(package_path, check_runner):
assert not (warning_asserts and all_warning_asserts), \
"Only one warnings meta file is allowed"

assert_none = not (failure_asserts or all_failure_asserts
or warning_asserts or all_warning_asserts)
assert_none = not (
failure_asserts or
Copy link
Member

Choose a reason for hiding this comment

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

I prefer having the binary operator on the new line to more clearly show its relation to the above line. I believe there is an error code for this that goes both ways, so I'll see if I can enable this check for the future.

all_failure_asserts or
warning_asserts or
all_warning_asserts
)

failures = {CheckAssert(failure.message, failure.details)
for failure in check_runner.failures}
Expand Down
7 changes: 7 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ exclude =
tests/packages,
semver.py,
max-line-length=100
# D100 Missing docstring in public module
# D101 Missing docstring in public class
# D102 Missing docstring in public method
# D103 Missing docstring in public function
# D104 Missing docstring in public package
# D105 Missing docstring in magic method
ignore = D100, D101, D102, D103, D104, D105
Copy link
Member

Choose a reason for hiding this comment

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

Flake8, by default, doesn't check docstrings. You must have a flake8 plugin installed in your system/environment.

Also refer to the list of default errors: http://flake8.pycqa.org/en/latest/user/error-codes.html


[coverage:run]
# branch = True
Expand Down