Skip to content

Commit

Permalink
Add reuse lint to CI and pre-commit hook
Browse files Browse the repository at this point in the history
The ruse tool is available in many distros[1] and can also be installed
via pip on other distros (e.g. Ubuntu).

Example results from github:

    =====  mdl  =====

    =====  shellcheck  =====

    =====  yamllint  =====

    =====  reuse  =====
    # SUMMARY

    * Bad licenses:
    * Deprecated licenses:
    * Licenses without file extension:
    * Missing licenses:
    * Unused licenses:
    * Used licenses: Apache-2.0, CC0-1.0
    * Read errors: 0
    * Files with copyright information: 238 / 238
    * Files with license information: 238 / 238

    Congratulations! Your project is compliant with version 3.0 of the REUSE Specification :-)

[1] https://git.fsfe.org/reuse/tool#installation-via-package-managers-recommended

Signed-off-by: Nir Soffer <[email protected]>
  • Loading branch information
nirs committed Oct 26, 2022
1 parent 6c78605 commit e81d646
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y python3-pip ruby
sudo gem install mdl
sudo pip3 install yamllint
sudo pip3 install yamllint reuse
- name: Run linters
run: ./hack/pre-commit.sh
Expand Down
5 changes: 5 additions & 0 deletions hack/pre-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,9 @@ run_check '.*\.(ba)?sh' shellcheck
# Install via: dnf install yamllint
run_check '.*\.ya?ml' yamllint -s -c "${scriptdir}/yamlconfig.yaml"

# reuse: https://git.fsfe.org/reuse/tool
# Install via: dnf install reuse
echo "===== reuse ====="
reuse lint

(! < "${OUTPUTS_FILE}" read -r)

0 comments on commit e81d646

Please sign in to comment.