Skip to content

Commit

Permalink
Update documentation, bump version (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
dosisod authored Oct 6, 2022
1 parent 0cb9711 commit b49c821
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
exclude = .git,__pycache__,.venv,test/data
per-file-ignores =
test/*:E501
refurb/main.py:E501
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ y = list() # noqa
Here, `noqa: FURB123` specifically ignores the FURB123 error for that line, and `noqa` ignores
all errors on that line.

## Enabling Checks

Certain checks are disabled by default, and need to be enabled first. You can do this using the
`--enable ERR` flag, where `ERR` is the error code of the check you want to enable. A disabled
check differs from an ignored check in that a disabled check will never be loaded, whereas an
ignored check will be loaded, an error will be emitted, and the error will be suppressed.

## Configuring Refurb

In addition to the command line arguments, you can also add your settings in the `pyproject.toml` file.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "refurb"
version = "1.2.0"
version = "1.3.0"
description = "A tool for refurbish and modernize Python codebases"
authors = ["dosisod"]
license = "GPL-3.0-only"
Expand Down
6 changes: 4 additions & 2 deletions refurb/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
def usage() -> None:
print(
"""\
usage: refurb [--ignore err] [--load path] [--debug] [--quiet] src [srcs...]
usage: refurb [--ignore err] [--load path] [--debug] [--quiet] [--enable] src [srcs...]
refurb [--help | -h]
refurb [--version | -v]
refurb --explain err
Expand All @@ -35,6 +35,8 @@ def usage() -> None:
for checks. Can be repeated.
--debug Print the AST representation of all files that where checked.
--quiet Suppress default "--explain" suggestion when an error occurs.
--enable Load a check which is disabled.
--explain Print the explaination/documentation from a given error code.
src A file or folder.
Expand Down Expand Up @@ -138,7 +140,7 @@ def format_errors(errors: Sequence[Error | str], quiet: bool) -> str:
done = "\n".join((str(error) for error in errors))

if not quiet and any(isinstance(error, Error) for error in errors):
done += "\n\nRun `refurb --explain ERR` to further explain an error. Use `--quiet` to silence this message" # noqa: E501
done += "\n\nRun `refurb --explain ERR` to further explain an error. Use `--quiet` to silence this message"

return done

Expand Down

0 comments on commit b49c821

Please sign in to comment.