jborean93 / pypsrp

PowerShell Remoting Protocol for Python
MIT License
328 stars 49 forks source link

Add black, isort, and mypy #140

Closed jborean93 closed 2 years ago

jborean93 commented 2 years ago

Changes the sole linting tool from pycodestyle to a combination of black, isort, and mypy. The isort tool makes it simpler to manage imports in a common manner and black's auto formatting is very helpful in ensuring a consistent codebase.

Mypy is enabled in a limited fashion to start introducting type annotations to the code base. The py.typed is also included in the sdist and wheel for users of this library to pick up for type validation.

Finally these are also added to a pre-commit hook that helps developers of this library more easily run the sanity checks if they wish to do so.

codecov[bot] commented 2 years ago

Codecov Report

Merging #140 (fd78167) into master (456ffeb) will decrease coverage by 0.08%. The diff coverage is 99.41%.

:exclamation: Current head fd78167 differs from pull request most recent head 8211dcb. Consider uploading reports for the commit 8211dcb to get more accurate results Impacted file tree graph

@@            Coverage Diff             @@
##           master     #140      +/-   ##
==========================================
- Coverage   99.66%   99.57%   -0.09%     
==========================================
  Files          13       13              
  Lines        3299     3330      +31     
==========================================
+ Hits         3288     3316      +28     
- Misses         11       14       +3     
Flag Coverage Δ
py3.10 99.57% <99.41%> (-0.09%) :arrow_down:
py3.6 99.57% <99.41%> (-0.09%) :arrow_down:
py3.7 99.57% <99.41%> (-0.09%) :arrow_down:
py3.8 99.54% <99.41%> (-0.09%) :arrow_down:
py3.9 99.54% <99.41%> (-0.09%) :arrow_down:
ubuntu 98.31% <98.73%> (-0.08%) :arrow_down:
windows 99.57% <99.41%> (-0.09%) :arrow_down:
x64 99.57% <99.41%> (-0.09%) :arrow_down:
x86 99.57% <99.41%> (-0.09%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/pypsrp/negotiate.py 97.74% <96.00%> (+0.01%) :arrow_up:
src/pypsrp/messages.py 99.69% <97.77%> (-0.31%) :arrow_down:
src/pypsrp/wsman.py 98.58% <98.46%> (-0.24%) :arrow_down:
src/pypsrp/powershell.py 99.85% <99.60%> (-0.15%) :arrow_down:
src/pypsrp/__init__.py 100.00% <100.00%> (ø)
src/pypsrp/_utils.py 100.00% <100.00%> (ø)
src/pypsrp/client.py 97.65% <100.00%> (+0.07%) :arrow_up:
src/pypsrp/complex_objects.py 100.00% <100.00%> (ø)
src/pypsrp/encryption.py 100.00% <100.00%> (ø)
src/pypsrp/exceptions.py 100.00% <100.00%> (ø)
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 456ffeb...8211dcb. Read the comment docs.