Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ body:
- type: markdown
attributes:
value: >
Thanks for helping us improve the library!
Thanks for helping us improve the library!
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ body:
- type: markdown
attributes:
value: >
Thanks for contributing 🎉
Thanks for contributing 🎉
6 changes: 0 additions & 6 deletions .github/collect_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,6 @@ def replace_bools(dct, true="Yes", false="No"):
dct[key] = false
return dct

def maybe_start_on_next_line(string):
# If `string` is multiline, prepend a \n to it.
if string is not None and len(string.split("\n")) > 1:
return "\n{}\n".format(string)
return string

mutable_dict = envinfo._asdict()

# Replace True with Yes, False with No
Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: |
pip install flake8
flake8 --version
flake8 ./
flake8

isort:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -83,3 +83,22 @@ jobs:
pip install black
black --version
black --check --diff .

bandit:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python: [3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
architecture: x64
- name: Run bandit
run: |
pip install bandit[toml]
bandit --version
bandit -r . -c pyproject.toml
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-yaml
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
- repo: https://github.com/PyCQA/autoflake
rev: v1.7.7
hooks:
- id: autoflake
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ As a contributor, you will only have to ensure coverage of your code by adding a

### Feature requests & bug report

Whether you encountered a problem, or you have a feature suggestion, your input has value and can be used by contributors to reference it in their developments. For this purpose, we advise you to use Github [issues](https://github.com/frgfm/validate-python-headers/issues).
Whether you encountered a problem, or you have a feature suggestion, your input has value and can be used by contributors to reference it in their developments. For this purpose, we advise you to use Github [issues](https://github.com/frgfm/validate-python-headers/issues).

First, check whether the topic wasn't already covered in an open / closed issue. If not, feel free to open a new one! When doing so, use issue templates whenever possible and provide enough information for other contributors to jump in.

Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# this target runs checks on all files
quality:
isort . -c
flake8 ./
flake8
mypy
black --check .
bandit -r . -c pyproject.toml
autoflake -r .

# this target runs checks on all files and potentially modifies some of them
style:
isort .
black .
autoflake --in-place -r .

# Build the docker image
build:
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# Header validator for your Python files

<p align="center">
<a href="https://github.com/frgfm/validate-python-headers/actions?query=workflow%3Abuilds">
<img alt="CI Status" src="https://img.shields.io/github/workflow/status/frgfm/validate-python-headers/builds?label=CI&logo=github&style=flat-square">
<a href="https://github.com/frgfm/validate-python-headers/actions/workflows/builds.yml">
<img alt="CI Status" src="https://img.shields.io/github/actions/workflow/status/frgfm/validate-python-headers/builds.yml?branch=main&label=CI&logo=github&style=flat-square">
</a>
<a href="https://github.com/ambv/black">
<img src="https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square" alt="black">
</a>
<a href="https://github.com/PyCQA/bandit">
<img src="https://img.shields.io/badge/security-bandit-yellow.svg?style=flat-square" alt="bandit">
</a>
<a href="https://www.codacy.com/gh/frgfm/validate-python-headers/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=frgfm/validate-python-headers&amp;utm_campaign=Badge_Grade"><img src="https://app.codacy.com/project/badge/Grade/4e50e872d9fd4a378b696bdc0aea9301"/></a>
<p align="center">
<img alt="GitHub release (latest by date)" src="https://img.shields.io/github/v/release/frgfm/validate-python-headers">
Expand Down Expand Up @@ -62,7 +65,7 @@ with:

Any sort of contribution is greatly appreciated!

You can find a short guide in [`CONTRIBUTING`](CONTRIBUTING) to help grow this project!
You can find a short guide in [`CONTRIBUTING`](CONTRIBUTING.md) to help grow this project!



Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh -l
set -eax

python /validate_headers.py "${1}" "${2}" $3 --folders $4 --ignore-files $5 --ignore-folders $6
python /validate_headers.py "${1}" "${2}" "${3}" --folders "${4}" --ignore-files "${5}" --ignore-folders "${6}"
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,12 @@ known_third_party = []
[tool.black]
line-length = 120
target-version = ['py38']

[tool.autoflake]
remove-unused-variables = true
remove-all-unused-imports = true
ignore-init-module-imports = true

[tool.bandit]
exclude_dirs = [".github/collect_env.py"]
skips = ["B101"]
2 changes: 1 addition & 1 deletion src/supported-licenses.json
Original file line number Diff line number Diff line change
Expand Up @@ -6152,4 +6152,4 @@
}
],
"releaseDate": "2022-05-08"
}
}