Skip to content

Commit

Permalink
[Linting] Check copyright notice in Python file in make lint (#5297)
Browse files Browse the repository at this point in the history
  • Loading branch information
jond01 committed Mar 18, 2024
1 parent 7218958 commit 68e514d
Show file tree
Hide file tree
Showing 18 changed files with 33 additions and 28 deletions.
7 changes: 4 additions & 3 deletions Makefile
Expand Up @@ -610,12 +610,13 @@ lint-imports: ## Validates import dependencies
lint-imports

.PHONY: lint
lint: fmt-check lint-imports ## Run lint on the code
lint: lint-check lint-imports ## Run lint on the code

.PHONY: fmt-check
fmt-check: ## Check the code (using ruff)
.PHONY: lint-check
lint-check: ## Check the code (using ruff)
@echo "Running ruff checks..."
python -m ruff check --exit-non-zero-on-fix
python -m ruff check --preview --select=CPY001 --exit-non-zero-on-fix
python -m ruff format --check

.PHONY: lint-go
Expand Down
2 changes: 1 addition & 1 deletion automation/deployment/__init__.py
@@ -1,4 +1,4 @@
# Copyright 2023 MLRun Authors
# Copyright 2023 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion automation/deployment/ce.py
@@ -1,4 +1,4 @@
# Copyright 2023 MLRun Authors
# Copyright 2023 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion automation/deployment/deployer.py
@@ -1,4 +1,4 @@
# Copyright 2023 MLRun Authors
# Copyright 2023 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion dependencies.py
@@ -1,4 +1,4 @@
# Copyright 2023 MLRun Authors
# Copyright 2023 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion mlrun/db/factory.py
@@ -1,4 +1,4 @@
# Copyright 2023 MLRun Authors
# Copyright 2023 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion mlrun/launcher/__init__.py
@@ -1,4 +1,4 @@
# Copyright 2023 MLRun Authors
# Copyright 2023 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion mlrun/launcher/base.py
@@ -1,4 +1,4 @@
# Copyright 2023 MLRun Authors
# Copyright 2023 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion mlrun/launcher/client.py
@@ -1,4 +1,4 @@
# Copyright 2023 MLRun Authors
# Copyright 2023 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion mlrun/launcher/factory.py
@@ -1,4 +1,4 @@
# Copyright 2023 MLRun Authors
# Copyright 2023 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion mlrun/launcher/local.py
@@ -1,4 +1,4 @@
# Copyright 2023 MLRun Authors
# Copyright 2023 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion mlrun/launcher/remote.py
@@ -1,4 +1,4 @@
# Copyright 2023 MLRun Authors
# Copyright 2023 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion packages.py
@@ -1,4 +1,4 @@
# Copyright 2023 MLRun Authors
# Copyright 2023 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
20 changes: 13 additions & 7 deletions pyproject.toml
Expand Up @@ -3,20 +3,26 @@ extend-include = ["*.ipynb"]
target-version = "py39"

[tool.ruff.lint]
select = [
"F", # pyflakes
"W", # pycodestyle
"E", # pycodestyle
"I", # isort
"UP", # pyupgrade
extend-select = [
"F", # pyflakes
"W", # pycodestyle
"E", # pycodestyle
"I", # isort
"UP", # pyupgrade
"CPY", # flake8-copyright
]
exclude = ["*.ipynb"]
explicit-preview-rules = true

[tool.ruff.lint.pycodestyle]
max-line-length = 120

[tool.ruff.lint.per-file-ignores]
[tool.ruff.lint.extend-per-file-ignores]
"__init__.py" = ["F401"]
"docs/**.py" = ["CPY001"]

[tool.ruff.lint.flake8-copyright]
author = "Iguazio"

[tool.pytest.ini_options]
addopts = "-v -rf --disable-warnings"
Expand Down
2 changes: 1 addition & 1 deletion server/api/launcher.py
@@ -1,4 +1,4 @@
# Copyright 2023 MLRun Authors
# Copyright 2023 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion server/api/rundb/__init__.py
@@ -1,4 +1,4 @@
# Copyright 2023 MLRun Authors
# Copyright 2023 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
3 changes: 1 addition & 2 deletions tests/integration/sdk_api/httpdb/runs/__init__.py
@@ -1,4 +1,4 @@
# Copyright 2023 MLRun Authors
# Copyright 2023 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -11,4 +11,3 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
3 changes: 1 addition & 2 deletions tests/integration/sdk_api/httpdb/runs/test_dask.py
@@ -1,4 +1,4 @@
# Copyright 2023 MLRun Authors
# Copyright 2023 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

import pytest

Expand Down

0 comments on commit 68e514d

Please sign in to comment.