Skip to content

GideonBear/enforce-https

Repository files navigation

enforce-https

pre-commit.ci status

A pre-commit hook to enforce https instead of http

Usage

Add this to your .pre-commit-config.yaml:

-   repo: https://github.com/GideonBear/pre-commit-enforce-https
    rev: v1.3.0
    hooks:
    -   id: enforce-https

Examples

- [This](http://google.com) is a link to google
+ [This](https://google.com) is a link to google
- data = requests.get('http://api.example.com').json
+ data = requests.get('https://api.example.com').json

Using allow-http to suppress enforce-https

protocol_sensitive_operation('http://example.com')  # allow-http
[This](http://example.com) is a protocol-sensitive link  <!-- allow-http -->

Using allow-http-in-x-lines to suppress enforce-https

<!-- allow-http-in-4-lines -->
```py
from library import function

function('http://example.com')
```

About

A pre-commit hook to enforce https instead of http

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages