From 929197c819829e12348f26a16354c286cca9a434 Mon Sep 17 00:00:00 2001 From: Benjamin Pelletier Date: Fri, 20 Oct 2023 11:17:43 -0700 Subject: [PATCH] [tooling] Apply Python lint & formatting to entire repo (#272) * Apply Python lint & formatting to entire repo * Remove null monitorlib test * Remove dependency * Remove reference to removed target --- .github/workflows/ci.yml | 11 +---------- Makefile | 5 +++-- monitoring/Makefile | 14 -------------- monitoring/mock_uss/Makefile | 14 +------------- monitoring/monitorlib/Makefile | 13 ------------- monitoring/prober/Makefile | 11 ----------- monitoring/uss_qualifier/Makefile | 7 +------ schemas/Makefile | 2 -- 8 files changed, 6 insertions(+), 71 deletions(-) delete mode 100644 monitoring/monitorlib/Makefile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec66e9fdb7..33681f30c3 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 @@ -71,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: 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..ae6ad9c5b1 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 +test: ./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