Skip to main content

ci pre-commit.ci status

sri-checker

A code formatter to add double indentation to function and method definitions.

Installation

pip install sri-checker

usage

usage: sri-checker [-h] [filenames ...]

positional arguments:
  filenames

options:
  -h, --help  show this help message and exit

pre-commit hook

See pre-commit for instructions

Sample .pre-commit-config.yaml:

- repo: https://github.com/jkittner/sri-checker
  rev: 0.1.1
  hooks:
    - id: sri-checker

If you are using public CDNs in any of your html-files and pre-commit.ci, you have to add this section to your .pre-commit-config.yaml since there is no access to the internet during setup or runtime in pre-commit.ci

ci:
  skip: [sri-checker]

Example

With an html-file base.html:

<link
  href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"
  rel="stylesheet"
  integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
  crossorigin="anonymous"
/>
sri-checker base.html

This will return an error end exit with 1.

base.html:1 SRI-hash incorrect
expected: sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN
got: sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL

Contents can also be passed via stdin:

cat base.html | sri-checker -

Metadata

Release files for sri-checker 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sri-checker 0.1.1
File Size Uploaded
sri_checker-0.1.1.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sri-checker 0.1.1
File Interpreter ABI Platform
sri_checker-0.1.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 8.5 kB

Release files / sri_checker-0.1.1.tar.gz

Download URL sri_checker-0.1.1.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7200b0ab2c018920585a4e4a8de3e8680e9dc619dd26cee5575355557a4f71a4
BLAKE2b-256 checksum
How to use checksums
767db46351f0aa82caaa19e79416f1ae9ba54c5839781141dbf5c9c780be8586
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / sri_checker-0.1.1-py2.py3-none-any.whl

Download URL sri_checker-0.1.1-py2.py3-none-any.whl
Size 4.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
f3fed7dbdd7bcb6570ad9c8f4ad3ac5dddf3385852ca8bd66bfb97e5ace0bc19
BLAKE2b-256 checksum
How to use checksums
2384ef1ff02ebd016bd0775ef6a7c8fba820d8693ed5a81f9eeedf2285ec313e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page