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.
pytest plugin that checks URLs for HTML-containing files.
.html
.rst
.md
(TODO: select renderer).ipynb
(requires nbconvert
)pip install pytest-check-links
pytest --check-links mynotebook.ipynb
default:
md,rst,html,ipynb
A comma-separated list of extensions to check
Also check whether links with #anchors
HTML files (either local, or with
served with html
in the Content-Type
) actually exist, and point to exactly one
named anchor.
A regular expression that matches URIs that should not be checked. Can be specified multiple times for multiple ignore patterns. This can be used for files that have a lot of links to GitHub pages, such as a Changelog. GitHub has rate limiting, which would normally cause these files to take up to an hour to complete for larger repositories. For example:
pytest --check-links --check-links-ignore "https://github.com/.*/pull/.*" CHANGELOG.md
Caching requires the installation of requests-cache
.
pip install requests-cache
If enabled, each occurrence of a link will be checked, no matter how many times it appears in a collection of files to check.
Cache requests when checking links. Caching is disabled by default, and this option must be provided, even if other cache configuration options are provided.
default:
.pytest-check-links-cache
Name of link cache, either the base name of a file or similar, depending on backend.
default:
sqlite3
Cache persistence backend. The other known backends are:
memory
redis
mongodb
See the requests-cache documentation for more information.
default:
None
(unlimited)
Time to cache link responses (seconds).
Backend-specific options for link cache, provided as key:value
. These are passed
directly to the requests_cache.CachedSession
constructor, as they vary depending
on the backend.
Values will be parsed as JSON first, so to overload the default of caching all
HTTP response codes (which requires a list of int
s):
--check-links-backend-opt allowable_codes:[200]
pytest-check-links
has adopted automatic code formatting so you shouldn't
need to worry too much about your code style.
As long as your code is valid,
the pre-commit hook should take care of how it should look.
You can invoke the pre-commit hook by hand at any time with:
pre-commit run
which should run any autoformatting on your code and tell you about any errors it couldn't fix automatically. You may also install black integration into your text editor to format code automatically.
If you have already committed files before setting up the pre-commit
hook with pre-commit install
, you can fix everything up using
pre-commit run --all-files
. You need to make the fixing commit
yourself after that.
Some of the hooks only run on CI by default, but you can invoke them by
running with the --hook-stage manual
argument.
FAQs
Check links in files
We found that pytest-check-links 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.