Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
flake8-annotations-coverage
Advanced tools
An extension for flake8 to report on files with a lot of code without type annotations.
This is mostly useful when you add type annotations to existing large codebase and want to know if new code in annotated modules is annotated.
Minimal annotations coverage percentage for each file can be configured via
--min-coverage-percents
option, default is 75.
Function is treated as annotated if it has annotation for at least one argument or return type. This is enough for mypy to threat the function not as dynamically typed.
pip install flake8-annotations-coverage
Sample file:
# test.py
def annotated_function(some_arg: int):
pass
def unannotated_function():
pass
Usage:
$ flake8 test.py
test.py:0:1: TAE001 too few type annotations
Error code | Description |
---|---|
TAE001 | Too few type annotations in file |
We would love you to contribute to our project. It's simple:
Here are useful tips:
make check
.
Please do it before CI does.FAQs
A flake8 extension that checks for type annotations coverage
We found that flake8-annotations-coverage demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.