Darglint

Latest version: v1.8.1

Safety actively analyzes 629532 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 10

1.5.6

Added

- Dockerfiles for testing each supported Python version. Also added a tox
section to allow for testing these dockerfiles. To build the images, you
can first do

make -C docker-build

then you can run

tox -e docker

And it will run the unit tests against Python3.5 to Python3.8.

Fixed

- Nested functions/methods. We should now handle nested functions/methods
explicitly. Previously, some attributes (such as returns, etc.) would
leak through nested functions into their parents. (Since we were just
walking the tree and looking for the presence of certain tokens.)
This also allowed for a nice refactoring of how we walk through/collect
data on the function ast.
- Exception handlers with named instances now have the correct type reported
with bare raises. Previously, if you had something like

def inverse(x):
try:
return 1 / x
except ZeroDivisionError as zde:
raise

darglint would incorrectly drop the `ZeroDivisionError` as a possible
error source when examining the function. This was due to named exception
handlers being handled differently from other exceptions. (The name had
to be stored in case a user did something like `raise err`.)
- Remove variables section from the numpy supported sections. Thanks to skarzi
for the pull request!

1.5.5

Fixed

- Permissions errors from searching for a config would previously
crash darglint. Fixed thanks to pawamoy.
- Some code highlighting issues fixed thanks to sobolevn.
- Documentation on installing test dependencies updated thanks to mathieu.
- Finally/else blocks for try statements are now handled when analyzing
whether an exception can be raised.

1.5.4

Added

- Added handling of positional-only arguments, and some tests for
mixing with positional/keyword arguments and keyword-only arguments.

1.5.3

Added

- Allowed sphinx docstrings to raise an `IndentError` when a
line is underindented in an item definition. This makes
troubleshooting incorrect indentation easier. (Previously,
it would have just failed to parse.)
- Configuration for log level. By default, now, all assertions
are logged at `ERROR`, and the default log level is `CRITICAL`.
If darglint doesn't act as expeced, then, the user could pass
the `--log-level` flag to rerun and see if an expectation was
missed.

Fixed

- Allowed `AssertionError` for functions which contain an `assert`
statement. Previously, this would result in an excess raises
error.
- Allowed qualified names in tuple exception handlers.
- Removed legacy token for quotation mark, which could cause poor
parsing in edge cases (due to the token not being used.)

1.5.2

Added

- A colon after an error in Numpy format is now reported
as an empty type error. Even though exception types are not a
part of the function signature, and even though it's not a
part of the numpy standard, this at least gives a hint to the
user that a dangling colon should be removed. Incidentally,
exceptions could have different types, and it could be somewhat
useful to know what those are.

Fixed

- Typo in readme fixed thanks to cthoyt.
- Underspecified types previously resulted in confusing error
messages because dargint incorrectly matched types up with the
arguments they describe. This is now corrected.
- Ignoring style errors wasn't working. Any error captured during
the parsing phase was just being added without respecting the
"ignore" configuration.

1.5.1

Fixed

- Make flake8 config use default config as a base configuration.
- Fix style being parsed for strictness in configuration parsing.

Page 2 of 10

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.