Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Burocrata to check/add license notices #435

Merged
merged 1 commit into from
Mar 1, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: python -m pip freeze

- name: Check code format
run: make black-check isort-check license-check
run: make check-format

style:
runs-on: ubuntu-latest
Expand All @@ -58,4 +58,4 @@ jobs:
run: python -m pip freeze

- name: Check code style
run: make flake8
run: make check-style
28 changes: 9 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
PROJECT=verde
TESTDIR=tmp-test-dir-with-unique-name
PYTEST_ARGS=--cov-config=../.coveragerc --cov-report=term-missing --cov=$(PROJECT) --doctest-modules -v --pyargs
CHECK_STYLE=$(PROJECT) doc tools
CHECK_STYLE=$(PROJECT) doc

help:
@echo "Commands:"
Expand All @@ -28,29 +28,19 @@ test:
cp $(TESTDIR)/.coverage* .
rm -rvf $(TESTDIR)

format: license isort black

check: black-check isort-check license-check flake8

black:
format:
isort $(CHECK_STYLE)
black $(CHECK_STYLE)
burocrata --extension=py $(PROJECT)

black-check:
black --check $(CHECK_STYLE)

license:
python tools/license_notice.py
check: check-format check-style

license-check:
python tools/license_notice.py --check

isort:
isort $(CHECK_STYLE)

isort-check:
check-format:
black --check $(CHECK_STYLE)
isort --check $(CHECK_STYLE)
burocrata --check --extension=py $(PROJECT)

flake8:
check-style:
flake8 $(CHECK_STYLE)

clean:
Expand Down
1 change: 1 addition & 0 deletions env/requirements-style.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ flake8-rst-docstrings
flake8-simplify
flake8-unused-arguments
pep8-naming
burocrata
5 changes: 2 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ dependencies:
- flake8-mutable
- flake8-rst-docstrings
- flake8-simplify
- flake8-unused-arguments
- pep8-naming
- pip:
# Install flake8-unused-arguments through pip
# (not available through conda yet)
- flake8-unused-arguments
- burocrata
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,12 @@ write_to = "verde/_version_generated.py"
[tool.isort]
profile = "black"
multi_line_output = 3

[tool.burocrata]
notice = '''
# Copyright (c) 2017 The Verde Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
#
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#'''
94 changes: 0 additions & 94 deletions tools/license_notice.py

This file was deleted.