From 9fa14d70ffff6fa64067e77d4a386b1a18822653 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Thu, 4 Nov 2021 07:56:46 +0100 Subject: [PATCH] Enable yamllint for all previously ignored files (#658) --- .github/FUNDING.yml | 2 + .github/workflows/codeql-analysis.yml | 35 ++++++++++------- .github/workflows/test-brew.yml | 26 +++++++------ .github/workflows/test-dashboard.yml | 34 +++++++++-------- .github/workflows/test-docker.yml | 32 ++++++++-------- .github/workflows/test-library.yml | 55 +++++++++++++++------------ .pre-commit-config.yaml | 18 +-------- codecov.yml | 6 ++- 8 files changed, 108 insertions(+), 100 deletions(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 40025c3c..b814208f 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1,3 @@ +--- open_collective: proxypy +... diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 2dd16165..b60cfc2c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,3 +1,4 @@ +--- # For most projects, this workflow file will not need changing; you simply need # to commit it to your repository. # @@ -5,14 +6,14 @@ # or to provide custom queries or build logic. name: "CodeQL" -on: +on: # yamllint disable-line rule:truthy push: branches: [develop, master] pull_request: # The branches below must be a subset of the branches above branches: [develop] schedule: - - cron: '0 14 * * 1' + - cron: '0 14 * * 1' jobs: analyze: @@ -23,10 +24,13 @@ jobs: fail-fast: false matrix: # Override automatic language detection by changing the below list - # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] + # Supported options are + # ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] language: ['python', 'javascript'] # Learn more... - # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection + # https://docs.github.com/en/github + # /finding-security-vulnerabilities-and-errors-in-your-code + # /configuring-code-scanning#overriding-automatic-language-detection steps: - name: Checkout repository @@ -46,26 +50,29 @@ jobs: uses: github/codeql-action/init@v1 with: languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. + # If you wish to specify custom queries, you can do so here or in a + # config file. By default, queries listed here will override any + # specified in a config file. Prefix the list here with "+" to use + # these queries and those in the config file. # queries: ./path/to/local/query, your-org/your-repo/queries@main # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) + # If this step fails, then you should remove it and run the build manually + # (see below) # - name: Autobuild # uses: github/codeql-action/autobuild@v1 # ℹī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language + # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following + # three lines and modify them (or add more) to build your code if your + # project uses a compiled language - #- run: | - # make bootstrap - # make release + # - run: | + # make bootstrap + # make release - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 +... diff --git a/.github/workflows/test-brew.yml b/.github/workflows/test-brew.yml index f51442f4..c2cff087 100644 --- a/.github/workflows/test-brew.yml +++ b/.github/workflows/test-brew.yml @@ -1,6 +1,7 @@ +--- name: Proxy.py Brew -on: [push, pull_request] +on: [push, pull_request] # yamllint disable-line rule:truthy jobs: build: @@ -13,14 +14,15 @@ jobs: max-parallel: 1 fail-fast: false steps: - - uses: actions/checkout@v2 - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python }} - - name: Brew - run: | - brew install ./helper/homebrew/develop/proxy.rb - - name: Verify - run: | - proxy -h + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - name: Brew + run: | + brew install ./helper/homebrew/develop/proxy.rb + - name: Verify + run: | + proxy -h +... diff --git a/.github/workflows/test-dashboard.yml b/.github/workflows/test-dashboard.yml index f302eeb8..513256f9 100644 --- a/.github/workflows/test-dashboard.yml +++ b/.github/workflows/test-dashboard.yml @@ -1,6 +1,7 @@ +--- name: Proxy.py Dashboard -on: [push, pull_request] +on: [push, pull_request] # yamllint disable-line rule:truthy jobs: build: @@ -13,18 +14,19 @@ jobs: max-parallel: 4 fail-fast: false steps: - - uses: actions/checkout@v2 - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node }} - - name: Install Dependencies - run: | - cd dashboard - npm install - cd .. - - name: Build Dashboard - run: | - cd dashboard - npm run build - cd .. + - uses: actions/checkout@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + - name: Install Dependencies + run: | + cd dashboard + npm install + cd .. + - name: Build Dashboard + run: | + cd dashboard + npm run build + cd .. +... diff --git a/.github/workflows/test-docker.yml b/.github/workflows/test-docker.yml index 7ec815ce..d6dfef6e 100644 --- a/.github/workflows/test-docker.yml +++ b/.github/workflows/test-docker.yml @@ -1,6 +1,7 @@ +--- name: Proxy.py Docker -on: [push, pull_request] +on: [push, pull_request] # yamllint disable-line rule:truthy jobs: build: @@ -13,17 +14,18 @@ jobs: max-parallel: 1 fail-fast: false steps: - - uses: actions/checkout@v2 - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -r requirements-testing.txt - pip install -r requirements-tunnel.txt - - name: Build - run: | - make container + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r requirements-testing.txt + pip install -r requirements-tunnel.txt + - name: Build + run: | + make container +... diff --git a/.github/workflows/test-library.yml b/.github/workflows/test-library.yml index 433529d9..a840ba2a 100644 --- a/.github/workflows/test-library.yml +++ b/.github/workflows/test-library.yml @@ -1,6 +1,7 @@ +--- name: Proxy.py Library -on: [push, pull_request] +on: [push, pull_request] # yamllint disable-line rule:truthy jobs: build: @@ -13,29 +14,34 @@ jobs: max-parallel: 4 fail-fast: false steps: - - uses: actions/checkout@v2 - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -r requirements-testing.txt - pip install -r requirements-tunnel.txt - - name: Run Tests - run: pytest --cov=proxy tests/ - - name: Upload coverage to Codecov - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - run: codecov - - name: Integration testing - if: matrix.os != 'windows' - run: | - pip install . - proxy --hostname 127.0.0.1 --enable-web-server --pid-file proxy.pid --log-file proxy.log & - ./tests/integration/main.sh + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r requirements-testing.txt + pip install -r requirements-tunnel.txt + - name: Run Tests + run: pytest --cov=proxy tests/ + - name: Upload coverage to Codecov + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: codecov + - name: Integration testing + if: matrix.os != 'windows' + run: | + pip install . + proxy \ + --hostname 127.0.0.1 \ + --enable-web-server \ + --pid-file proxy.pid \ + --log-file proxy.log \ + & + ./tests/integration/main.sh tox: name: ${{ matrix.toxenv }} @@ -126,3 +132,4 @@ jobs: run: >- print("All's good") shell: python +... diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f6c2de33..258a80b0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -85,12 +85,10 @@ repos: - id: check-byte-order-marker - id: check-case-conflict # disabled due to pre-commit/pre-commit-hooks#159 - #- id: check-docstring-first + # - id: check-docstring-first - id: check-json - id: check-symlinks - id: check-yaml - # args: - # - --unsafe - id: detect-private-key # Heavy checks: @@ -141,20 +139,6 @@ repos: rev: v1.26.2 hooks: - id: yamllint - exclude: | - (?x) - ^ - \.pre-commit-config\.yaml| - ( - \.github/( - workflows/( - codeql-analysis|test-(brew|dashboard|docker|library) - )| - FUNDING - )| - codecov - )\.yml - $ args: - --strict types: [file, yaml] diff --git a/codecov.yml b/codecov.yml index f393de9c..5a8572e1 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,7 +1,8 @@ +--- codecov: - require_ci_to_pass: yes + require_ci_to_pass: yes # yamllint disable-line rule:truthy notify: - wait_for_ci: yes + wait_for_ci: yes # yamllint disable-line rule:truthy coverage: status: project: @@ -10,3 +11,4 @@ coverage: patch: default: threshold: 1% +...