diff --git a/Makefile b/Makefile index cfa49d2f2cc..a826a450db0 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/automation/deployment/__init__.py b/automation/deployment/__init__.py index 7f557697af7..222618272c2 100644 --- a/automation/deployment/__init__.py +++ b/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. diff --git a/automation/deployment/ce.py b/automation/deployment/ce.py index d2d3c929e86..3b37adfaf65 100644 --- a/automation/deployment/ce.py +++ b/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. diff --git a/automation/deployment/deployer.py b/automation/deployment/deployer.py index afabe5ce81b..a82763ffcbb 100644 --- a/automation/deployment/deployer.py +++ b/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. diff --git a/dependencies.py b/dependencies.py index 22d843f13b2..8d57bece716 100644 --- a/dependencies.py +++ b/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. diff --git a/mlrun/db/factory.py b/mlrun/db/factory.py index 1a034f0c66b..ebbbdd07aea 100644 --- a/mlrun/db/factory.py +++ b/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. diff --git a/mlrun/launcher/__init__.py b/mlrun/launcher/__init__.py index 7f557697af7..222618272c2 100644 --- a/mlrun/launcher/__init__.py +++ b/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. diff --git a/mlrun/launcher/base.py b/mlrun/launcher/base.py index 3eaab48cf7c..a3709b9c634 100644 --- a/mlrun/launcher/base.py +++ b/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. diff --git a/mlrun/launcher/client.py b/mlrun/launcher/client.py index 75e573d79cd..5f17e47d35a 100644 --- a/mlrun/launcher/client.py +++ b/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. diff --git a/mlrun/launcher/factory.py b/mlrun/launcher/factory.py index 49e55bc44dc..6afaf8db538 100644 --- a/mlrun/launcher/factory.py +++ b/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. diff --git a/mlrun/launcher/local.py b/mlrun/launcher/local.py index 0f817fda69e..26249ac6c0c 100644 --- a/mlrun/launcher/local.py +++ b/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. diff --git a/mlrun/launcher/remote.py b/mlrun/launcher/remote.py index fb8f7c85ad1..ae3e61e6197 100644 --- a/mlrun/launcher/remote.py +++ b/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. diff --git a/packages.py b/packages.py index 7fd649fa3f4..30d6389d930 100644 --- a/packages.py +++ b/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. diff --git a/pyproject.toml b/pyproject.toml index 58cf9835363..848368887ff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/server/api/launcher.py b/server/api/launcher.py index a0f7ef1a468..ea453c93a30 100644 --- a/server/api/launcher.py +++ b/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. diff --git a/server/api/rundb/__init__.py b/server/api/rundb/__init__.py index 7f557697af7..222618272c2 100644 --- a/server/api/rundb/__init__.py +++ b/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. diff --git a/tests/integration/sdk_api/httpdb/runs/__init__.py b/tests/integration/sdk_api/httpdb/runs/__init__.py index 245d0063f46..84f1919a063 100644 --- a/tests/integration/sdk_api/httpdb/runs/__init__.py +++ b/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. @@ -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. -# diff --git a/tests/integration/sdk_api/httpdb/runs/test_dask.py b/tests/integration/sdk_api/httpdb/runs/test_dask.py index 036276079a5..8e6c5cb342b 100644 --- a/tests/integration/sdk_api/httpdb/runs/test_dask.py +++ b/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. @@ -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