From ad1ce207019b156c055a34426dfab5a2d02cecc6 Mon Sep 17 00:00:00 2001 From: Simon Brugman Date: Thu, 6 Jul 2023 15:29:57 +0200 Subject: [PATCH] ci: replace google addlicense with ruff --- .github/workflows/license.yml | 27 --------------------------- popmon/version.py | 19 +++++++++++++++++++ pyproject.toml | 13 ++++++++++++- 3 files changed, 31 insertions(+), 28 deletions(-) delete mode 100644 .github/workflows/license.yml diff --git a/.github/workflows/license.yml b/.github/workflows/license.yml deleted file mode 100644 index bd736477..00000000 --- a/.github/workflows/license.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: license - -on: - push: - branches: - - master - - develop - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Golang - uses: actions/setup-go@v2 - with: - go-version: '^1.16' # See https://github.com/google/go-licenses/issues/75 - - name: Install addlicense - run: | - export PATH=${PATH}:`go env GOPATH`/bin - go install github.com/google/addlicense@latest - - name: Check license - run: | - export PATH=${PATH}:`go env GOPATH`/bin - addlicense -check -l mit -c "ING Analytics Wholesale Banking" $(find popmon/ -type f -name '*.py' -not -path popmon/version.py) diff --git a/popmon/version.py b/popmon/version.py index 98da246a..8e21e55a 100644 --- a/popmon/version.py +++ b/popmon/version.py @@ -1 +1,20 @@ +# Copyright (c) 2023 ING Analytics Wholesale Banking +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + version = "1.4.4" diff --git a/pyproject.toml b/pyproject.toml index d56712fc..7ddd2f36 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,7 +77,7 @@ popmon_run = "popmon.pipeline.amazing_pipeline:run" target-version = "py37" line-length = 120 namespace-packages = ["popmon"] -select = ["ALL"] +select = ["ALL", "CPY001"] ignore = [ # COM812 is incompatible with COM819 "COM", @@ -145,6 +145,8 @@ ignore = [ "PT011", # Too many statements "PLR0915", + # Copyright + "CPY001", ] # Sphinx config @@ -157,6 +159,9 @@ ignore = [ # implicit namespaces "INP001", + + # Copyright + "CPY001", ] "popmon/config.py" = [ @@ -177,8 +182,14 @@ ignore = [ # Found useless expression. Either assign it to a variable or remove it. "B018", + + # Copyright + "CPY001", ] +[tool.ruff.flake8-copyright] +notice-rgx = """(?mis)Copyright \\(c\\) 2023 ING Analytics Wholesale Banking.+""" + [tool.pytest.ini_options] markers = ["spark"]