Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark the Darker package as annotated with type hints #507

Merged
merged 2 commits into from
Mar 15, 2024
Merged
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
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@ Added
- Update 3rd party GitHub actions to avoid using deprecated NodeJS versions.
- CI build now shows a diff between output of ``darker --help`` and its output as
included ``README.rst`` in case the two differ.
- Mark the Darker package as annotated with type hints.

Removed
-------
@@ -551,7 +552,8 @@ Added
-----
- Initial implementation

.. _Unreleased: https://github.com/akaihola/darker/compare/1.7.3...HEAD
.. _Unreleased: https://github.com/akaihola/darker/compare/2.0.0...HEAD
.. _2.0.0: https://github.com/akaihola/darker/compare/1.7.3...2.0.0
.. _1.7.3: https://github.com/akaihola/darker/compare/1.7.2...1.7.3
.. _1.7.2: https://github.com/akaihola/darker/compare/1.7.1...1.7.2
.. _1.7.1: https://github.com/akaihola/darker/compare/1.7.0...1.7.1
4 changes: 4 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -38,6 +38,10 @@ python_requires = >=3.8
[options.packages.find]
where = src

[options.package_data]
darker =
py.typed

[options.entry_points]
console_scripts =
darker = darker.__main__:main_with_error_handling

Unchanged files with check annotations Beta

try:
# Black 24.2.1 and later
from black.parsing import ASTSafetyError # pylint: disable=ungrouped-imports

Check failure on line 12 in src/darker/verification.py

GitHub Actions / Mypy

src/darker/verification.py#L12

Module "black.parsing" has no attribute "ASTSafetyError" [attr-defined]
except ImportError:
# Black 24.2.0 and earlier
ASTSafetyError = AssertionError