From f1095a2311a6494251727f70d110e672e86fc800 Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Wed, 10 May 2023 05:52:50 +1000 Subject: [PATCH 01/11] Test lint action --- .github/workflows/linting.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/linting.yaml diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml new file mode 100644 index 00000000000..e4cde9df4ac --- /dev/null +++ b/.github/workflows/linting.yaml @@ -0,0 +1,19 @@ +name: linting +on: pull_request + +jobs: + checkLinting: + runs-on: windows-latest + strategy: + matrix: + python-version: [3.7] + steps: + - name: Install dependencies + run: | + python -m pip install flake8~=3.7.7 flake8-tabs == 2.1.0 + - name: generate diff + run: | + git diff -U0 ${GITHUB_BASE_REF} >_lint.diff + - name: Run flake8 + run: | + py -Xutf8 -m flake8 --diff --config=tests/lint/flake8.ini <_lint.diff From cea07cf48218704595d15d5eadbb01ecd57dae2a Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Wed, 10 May 2023 06:13:02 +1000 Subject: [PATCH 02/11] spaces instead of tabs. --- .github/workflows/linting.yaml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index e4cde9df4ac..d74db1d6ffc 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -2,18 +2,18 @@ name: linting on: pull_request jobs: - checkLinting: - runs-on: windows-latest - strategy: - matrix: - python-version: [3.7] - steps: - - name: Install dependencies - run: | - python -m pip install flake8~=3.7.7 flake8-tabs == 2.1.0 - - name: generate diff - run: | - git diff -U0 ${GITHUB_BASE_REF} >_lint.diff - - name: Run flake8 - run: | - py -Xutf8 -m flake8 --diff --config=tests/lint/flake8.ini <_lint.diff + checkLinting: + runs-on: windows-latest + strategy: + matrix: + python-version: [3.7] + steps: + - name: Install dependencies + run: | + python -m pip install flake8~=3.7.7 flake8-tabs == 2.1.0 + - name: generate diff + run: | + git diff -U0 ${GITHUB_BASE_REF} >_lint.diff + - name: Run flake8 + run: | + py -Xutf8 -m flake8 --diff --config=tests/lint/flake8.ini <_lint.diff From 7f51887b457002b14a83190b0427bc8924792ece Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Wed, 10 May 2023 06:19:58 +1000 Subject: [PATCH 03/11] fix yaml --- .github/workflows/linting.yaml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index d74db1d6ffc..f08261574ca 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -4,16 +4,16 @@ on: pull_request jobs: checkLinting: runs-on: windows-latest - strategy: - matrix: - python-version: [3.7] - steps: - - name: Install dependencies - run: | - python -m pip install flake8~=3.7.7 flake8-tabs == 2.1.0 - - name: generate diff - run: | - git diff -U0 ${GITHUB_BASE_REF} >_lint.diff - - name: Run flake8 - run: | - py -Xutf8 -m flake8 --diff --config=tests/lint/flake8.ini <_lint.diff + strategy: + matrix: + python-version: [3.7] + steps: + - name: Install dependencies + run: | + python -m pip install flake8~=3.7.7 flake8-tabs == 2.1.0 + - name: generate diff + run: | + git diff -U0 ${GITHUB_BASE_REF} >_lint.diff + - name: Run flake8 + run: | + py -Xutf8 -m flake8 --diff --config=tests/lint/flake8.ini <_lint.diff \ No newline at end of file From 8cb6a14262e21709f48e72ad7a7a9fc623b0b59c Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Wed, 10 May 2023 06:26:07 +1000 Subject: [PATCH 04/11] fix yaml --- .github/workflows/linting.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index f08261574ca..8fe8d460a27 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -7,13 +7,13 @@ jobs: strategy: matrix: python-version: [3.7] - steps: - - name: Install dependencies - run: | - python -m pip install flake8~=3.7.7 flake8-tabs == 2.1.0 - - name: generate diff - run: | - git diff -U0 ${GITHUB_BASE_REF} >_lint.diff - - name: Run flake8 - run: | - py -Xutf8 -m flake8 --diff --config=tests/lint/flake8.ini <_lint.diff \ No newline at end of file + steps: + - name: Install dependencies + run: | + python -m pip install flake8~=3.7.7 flake8-tabs == 2.1.0 + - name: generate diff + run: | + git diff -U0 ${GITHUB_BASE_REF} >_lint.diff + - name: Run flake8 + run: | + py -Xutf8 -m flake8 --diff --config=tests/lint/flake8.ini <_lint.diff From b60952262b4b6a9fc199f477f664ed97a146bc2f Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Wed, 10 May 2023 06:48:42 +1000 Subject: [PATCH 05/11] fix yaml --- .github/workflows/linting.yaml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 8fe8d460a27..714e725a66a 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -2,18 +2,18 @@ name: linting on: pull_request jobs: - checkLinting: - runs-on: windows-latest - strategy: - matrix: - python-version: [3.7] - steps: - - name: Install dependencies - run: | - python -m pip install flake8~=3.7.7 flake8-tabs == 2.1.0 - - name: generate diff - run: | - git diff -U0 ${GITHUB_BASE_REF} >_lint.diff - - name: Run flake8 - run: | - py -Xutf8 -m flake8 --diff --config=tests/lint/flake8.ini <_lint.diff + checkLinting: + runs-on: windows-latest + strategy: + matrix: + python-version: [3.7] + steps: + - name: Install dependencies + run: | + python -m pip install flake8~=3.7.7 flake8-tabs == 2.1.0 + - name: generate diff + run: | + git diff -U0 ${GITHUB_BASE_REF} >_lint.diff + - name: Run flake8 + run: | + py -Xutf8 -m flake8 --diff --config=tests/lint/flake8.ini <_lint.diff From d246269aa76d32fa052ce9de36dcfc318e84a347 Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Wed, 10 May 2023 06:51:25 +1000 Subject: [PATCH 06/11] fix yaml --- .github/workflows/linting.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 714e725a66a..64a787615a4 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -10,7 +10,7 @@ jobs: steps: - name: Install dependencies run: | - python -m pip install flake8~=3.7.7 flake8-tabs == 2.1.0 + python -m pip install flake8~=3.7.7 flake8-tabs==2.1.0 - name: generate diff run: | git diff -U0 ${GITHUB_BASE_REF} >_lint.diff From 757255cdaed45f6d76796aba229d0f1a8e771ee5 Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Wed, 10 May 2023 12:11:37 +1000 Subject: [PATCH 07/11] spaces instead of tabs. --- .github/workflows/linting.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 64a787615a4..8e2fec63562 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -8,12 +8,18 @@ jobs: matrix: python-version: [3.7] steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.base.sha }} + - uses: actions/checkout@v3 + with: + ref: ${{ github.sha }} - name: Install dependencies run: | python -m pip install flake8~=3.7.7 flake8-tabs==2.1.0 - name: generate diff run: | - git diff -U0 ${GITHUB_BASE_REF} >_lint.diff + git diff -U0 ${{ github.event.pull_request.base.sha }} >_lint.diff - name: Run flake8 run: | py -Xutf8 -m flake8 --diff --config=tests/lint/flake8.ini <_lint.diff From 6825f07340861e0b9694536f776730d16bc0f807 Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Wed, 10 May 2023 12:32:04 +1000 Subject: [PATCH 08/11] add a linting error --- source/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/core.py b/source/core.py index 724241b59b2..ecb53898358 100644 --- a/source/core.py +++ b/source/core.py @@ -28,7 +28,7 @@ import addonHandler import extensionPoints import garbageHandler -import NVDAState +import NVDAState def __getattr__(attrName: str) -> Any: @@ -44,7 +44,7 @@ def __getattr__(attrName: str) -> Any: raise AttributeError(f"module {repr(__name__)} has no attribute {repr(attrName)}") -# Inform those who want to know that NVDA has finished starting up. +# Inform those who want to know that NVDA has finished starting up. postNvdaStartup = extensionPoints.Action() PUMP_MAX_DELAY = 10 From f3ece53f5d5019fa0358672eae46a985e25f3883 Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Wed, 10 May 2023 12:32:09 +1000 Subject: [PATCH 09/11] spaces instead of tabs. --- .github/workflows/linting.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 8e2fec63562..6d1b3b37845 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -19,7 +19,7 @@ jobs: python -m pip install flake8~=3.7.7 flake8-tabs==2.1.0 - name: generate diff run: | - git diff -U0 ${{ github.event.pull_request.base.sha }} >_lint.diff + git diff -U0 ${{ github.event.pull_request.base.sha }} | Out-File -FilePath _lint.diff - name: Run flake8 run: | - py -Xutf8 -m flake8 --diff --config=tests/lint/flake8.ini <_lint.diff + Get-Content -Path _lint.diff | py -Xutf8 -m flake8 --diff --config=tests/lint/flake8.ini From fb9b695415ffd3f911e598203a2e1e5c4672da9d Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Wed, 10 May 2023 12:48:46 +1000 Subject: [PATCH 10/11] fix yaml --- .github/workflows/linting.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 6d1b3b37845..1386cc9351b 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -4,9 +4,6 @@ on: pull_request jobs: checkLinting: runs-on: windows-latest - strategy: - matrix: - python-version: [3.7] steps: - uses: actions/checkout@v3 with: @@ -14,12 +11,16 @@ jobs: - uses: actions/checkout@v3 with: ref: ${{ github.sha }} - - name: Install dependencies + - uses: actions/setup-python@v4 + with: + python-version: 3.7.9 + architecture: x86 + - name: Install required Python packages run: | python -m pip install flake8~=3.7.7 flake8-tabs==2.1.0 - - name: generate diff + - name: generate pull request diff run: | git diff -U0 ${{ github.event.pull_request.base.sha }} | Out-File -FilePath _lint.diff - name: Run flake8 run: | - Get-Content -Path _lint.diff | py -Xutf8 -m flake8 --diff --config=tests/lint/flake8.ini + Get-Content -Path _lint.diff | python -Xutf8 -m flake8 --diff --config=tests/lint/flake8.ini From 4ae47ef18094cb4f9f1c42bacd2cdb832c3c1d7a Mon Sep 17 00:00:00 2001 From: Michael Curran Date: Wed, 10 May 2023 13:15:48 +1000 Subject: [PATCH 11/11] fix lint --- source/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/core.py b/source/core.py index ecb53898358..724241b59b2 100644 --- a/source/core.py +++ b/source/core.py @@ -28,7 +28,7 @@ import addonHandler import extensionPoints import garbageHandler -import NVDAState +import NVDAState def __getattr__(attrName: str) -> Any: @@ -44,7 +44,7 @@ def __getattr__(attrName: str) -> Any: raise AttributeError(f"module {repr(__name__)} has no attribute {repr(attrName)}") -# Inform those who want to know that NVDA has finished starting up. +# Inform those who want to know that NVDA has finished starting up. postNvdaStartup = extensionPoints.Action() PUMP_MAX_DELAY = 10