From 692763d173fbfd1fa8d29a59bd5a63aaab42ad19 Mon Sep 17 00:00:00 2001 From: Benjamin Pelletier Date: Thu, 19 Oct 2023 17:15:49 +0000 Subject: [PATCH 1/4] Apply Python lint & formatting to entire repo --- Makefile | 5 +++-- monitoring/Makefile | 14 -------------- monitoring/mock_uss/Makefile | 12 ------------ monitoring/monitorlib/Makefile | 13 ------------- monitoring/prober/Makefile | 11 ----------- monitoring/uss_qualifier/Makefile | 7 +------ schemas/Makefile | 2 -- 7 files changed, 4 insertions(+), 60 deletions(-) delete mode 100644 monitoring/monitorlib/Makefile diff --git a/Makefile b/Makefile index b074ce18f4..26453f6cda 100644 --- a/Makefile +++ b/Makefile @@ -11,10 +11,11 @@ endif .PHONY: format format: json-schema + docker run --rm -v "$(CURDIR):/code" -w /code pyfound/black:22.10.0 black --exclude /interfaces . cd monitoring && make format .PHONY: lint -lint: shell-lint +lint: shell-lint python-lint cd monitoring && make lint cd schemas && make lint @@ -23,7 +24,7 @@ check-hygiene: python-lint hygiene validate-uss-qualifier-docs shell-lint .PHONY: python-lint python-lint: - cd monitoring && make python-lint + docker run --rm -v "$(CURDIR):/code" -w /code pyfound/black:22.10.0 black --check --exclude /interfaces . || (echo "Linter didn't succeed. You can use the following command to fix python linter issues: make format" && exit 1) .PHONY: hygiene hygiene: diff --git a/monitoring/Makefile b/monitoring/Makefile index 90b1301200..8df32f6bf3 100644 --- a/monitoring/Makefile +++ b/monitoring/Makefile @@ -1,23 +1,10 @@ .PHONY: lint lint: cd uss_qualifier && make lint - cd mock_uss && make lint - cd monitorlib && make lint - cd prober && make lint - -.PHONY: python-lint -python-lint: - cd uss_qualifier && make python-lint - cd mock_uss && make python-lint - cd monitorlib && make python-lint - cd prober && make python-lint .PHONY: format format: cd uss_qualifier && make format - cd mock_uss && make format - cd monitorlib && make format - cd prober && make format .PHONY: build build: @@ -25,7 +12,6 @@ build: .PHONY: test test: - cd monitorlib && make test cd mock_uss && make test cd uss_qualifier && make test cd prober && make test diff --git a/monitoring/mock_uss/Makefile b/monitoring/mock_uss/Makefile index 4870651fae..d15c037600 100644 --- a/monitoring/mock_uss/Makefile +++ b/monitoring/mock_uss/Makefile @@ -1,15 +1,3 @@ -.PHONY: lint -lint: python-lint - echo "mock_uss lint complete" - -.PHONY: python-lint -python-lint: - docker run --rm -v "$(CURDIR):/code" -w /code pyfound/black:22.10.0 black --check . || (echo "Linter didn't succeed. You can use the following command to fix python linter issues: make format" && exit 1) - -.PHONY: format -format: - docker run --rm -v "$(CURDIR):/code" -w /code pyfound/black:22.10.0 black . - .PHONY: test test: lint ./run_locally_test_geoawareness.sh diff --git a/monitoring/monitorlib/Makefile b/monitoring/monitorlib/Makefile deleted file mode 100644 index 6416aa01bf..0000000000 --- a/monitoring/monitorlib/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -.PHONY: lint -lint: python-lint - -.PHONY: python-lint -python-lint: - docker run --rm -v "$(CURDIR):/code" -w /code pyfound/black:22.10.0 black --check . || (echo "Linter didn't succeed. You can use the following command to fix python linter issues: make format" && exit 1) - -.PHONY: format -format: - docker run --rm -v "$(CURDIR):/code" -w /code pyfound/black:22.10.0 black . - -.PHONY: test -test: lint diff --git a/monitoring/prober/Makefile b/monitoring/prober/Makefile index 4470bacc64..a6bc88abb9 100644 --- a/monitoring/prober/Makefile +++ b/monitoring/prober/Makefile @@ -1,14 +1,3 @@ -.PHONY: lint -lint: python-lint - -.PHONY: python-lint -python-lint: - docker run --rm -v "$(CURDIR):/code" -w /code pyfound/black:22.10.0 black --check . || (echo "Linter didn't succeed. You can use the following command to fix python linter issues: make format" && exit 1) - -.PHONY: format -format: - docker run --rm -v "$(CURDIR):/code" -w /code pyfound/black:22.10.0 black . - .PHONY: test test: ./scripts/test_docker_fully_mocked.sh diff --git a/monitoring/uss_qualifier/Makefile b/monitoring/uss_qualifier/Makefile index 062a8dfe29..ce5d577958 100644 --- a/monitoring/uss_qualifier/Makefile +++ b/monitoring/uss_qualifier/Makefile @@ -1,18 +1,13 @@ .PHONY: lint -lint: validate-docs python-lint +lint: validate-docs .PHONY: validate-docs validate-docs: ./scripts/validate_test_definitions.sh ./scripts/format_test_suite_docs.sh --lint -.PHONY: python-lint -python-lint: - docker run --rm -v "$(CURDIR):/code" -w /code pyfound/black:22.10.0 black --check . || (echo "Linter didn't succeed. You can use the following command to fix python linter issues: make format" && exit 1) - .PHONY: format format: format-documentation - docker run --rm -v "$(CURDIR):/code" -w /code pyfound/black:22.10.0 black . .PHONY: format-documentation format-documentation: diff --git a/schemas/Makefile b/schemas/Makefile index f2214ed280..08c2df14fb 100644 --- a/schemas/Makefile +++ b/schemas/Makefile @@ -1,9 +1,7 @@ .PHONY: format format: - docker run --rm -v "$(CURDIR):/code" -w /code pyfound/black:22.10.0 black . ./manage_type_schemas.sh --generate .PHONY: lint lint: - docker run --rm -v "$(CURDIR):/code" -w /code pyfound/black:22.10.0 black --check . || (echo "Linter didn't succeed. You can use the following command to fix python linter issues: make format" && exit 1) ./manage_type_schemas.sh --check From 789e2782cd43bb3b4eb3c849db8ce7f22c018068 Mon Sep 17 00:00:00 2001 From: Benjamin Pelletier Date: Thu, 19 Oct 2023 22:10:07 +0000 Subject: [PATCH 2/4] Remove null monitorlib test --- .github/workflows/ci.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec66e9fdb7..2993e10630 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,15 +30,6 @@ jobs: - name: Shell lint run: make shell-lint - monitorlib-test: - name: monitorlib tests - uses: ./.github/workflows/monitoring-test.yml - with: - name: monitorlib - script: | - cd monitoring/monitorlib - make test - mock_uss-test: name: mock_uss tests uses: ./.github/workflows/monitoring-test.yml From d8abe4e0a983ef1c6fbf09b02eb54064ea3e33e0 Mon Sep 17 00:00:00 2001 From: Benjamin Pelletier Date: Thu, 19 Oct 2023 22:12:21 +0000 Subject: [PATCH 3/4] Remove dependency --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2993e10630..33681f30c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: publish-gh-pages: name: Publish GitHub Pages - needs: [hygiene-tests, monitorlib-test, mock_uss-test, uss_qualifier-test, prober-test] + needs: [hygiene-tests, mock_uss-test, uss_qualifier-test, prober-test] if: ${{ always() && contains(join(needs.*.result, ','), 'success') }} runs-on: ubuntu-latest permissions: From c349f80256264d9dd3bd3f848bf6e5d37aaf9ced Mon Sep 17 00:00:00 2001 From: Benjamin Pelletier Date: Thu, 19 Oct 2023 22:16:49 +0000 Subject: [PATCH 4/4] Remove reference to removed target --- monitoring/mock_uss/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitoring/mock_uss/Makefile b/monitoring/mock_uss/Makefile index d15c037600..ae6ad9c5b1 100644 --- a/monitoring/mock_uss/Makefile +++ b/monitoring/mock_uss/Makefile @@ -1,3 +1,3 @@ .PHONY: test -test: lint +test: ./run_locally_test_geoawareness.sh