From 5248b0110dc710cea41f106d6997672af5e4e06e Mon Sep 17 00:00:00 2001 From: Brett Berry Date: Wed, 2 Mar 2022 12:18:54 -0700 Subject: [PATCH 01/19] Add Main class --- main.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..6b961fa --- /dev/null +++ b/main.py @@ -0,0 +1,6 @@ +class Main: + def __init__(self): + print("In Constructor") + + def do_something(self): + print(f"Let's do something!") From 9a6623d5847e083a2f5e9dac10286979ba9b6ec2 Mon Sep 17 00:00:00 2001 From: Brett Berry Date: Wed, 2 Mar 2022 12:19:15 -0700 Subject: [PATCH 02/19] Add github action --- .github/workflows/lint.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..e69de29 From 1262035a29973a4420a20e085dd6a89ebfcca937 Mon Sep 17 00:00:00 2001 From: Brett Berry Date: Wed, 2 Mar 2022 12:20:51 -0700 Subject: [PATCH 03/19] Add github action --- .github/workflows/lint.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e69de29..6367080 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -0,0 +1,28 @@ +name: Lint # name of the action (displayed in the github interface) + +on: # event list + pull_request: # on a pull request to each of these branches + branches: + - develop + paths: + - '*.py' + +jobs: + flake8_py3: + runs-on: ubuntu-latest + steps: + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified + - name: Code Checkout + uses: actions/checkout@v2 + - name: Install flake8 + run: pip install flake8 + - name: Run flake8 + uses: suo/flake8-github-action@releases/v1 + with: + checkName: 'flake8_py3' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 0c572efeece991754accf22a4a256653d99e1a2e Mon Sep 17 00:00:00 2001 From: Brett Berry Date: Wed, 2 Mar 2022 14:40:27 -0700 Subject: [PATCH 04/19] Trying different linting action --- .github/workflows/lint.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6367080..3d8df29 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,14 +15,13 @@ jobs: uses: actions/setup-python@v2 with: python-version: '3.8' - architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified + architecture: 'x64' - name: Code Checkout uses: actions/checkout@v2 - name: Install flake8 run: pip install flake8 - name: Run flake8 - uses: suo/flake8-github-action@releases/v1 + uses: grantmcconnaughey/lintly-flake8-github-action@v1.0 with: - checkName: 'flake8_py3' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + failIf: any + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 3ec5c237c0aa954c1c4d3c4703cb9074271a1d2d Mon Sep 17 00:00:00 2001 From: Brett Berry Date: Wed, 2 Mar 2022 14:43:36 -0700 Subject: [PATCH 05/19] Trying different linting action --- .github/workflows/lint.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3d8df29..8f7ad08 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,17 +11,11 @@ jobs: flake8_py3: runs-on: ubuntu-latest steps: - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.8' - architecture: 'x64' - name: Code Checkout - uses: actions/checkout@v2 - - name: Install flake8 - run: pip install flake8 + uses: actions/checkout@v1 - name: Run flake8 uses: grantmcconnaughey/lintly-flake8-github-action@v1.0 with: failIf: any - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + token: ${{ secrets.GITHUB_TOKEN }} + args: "--ignore=E121,E123 ." \ No newline at end of file From 440e44d8787b25b42a9be73627b8d8165934ca2c Mon Sep 17 00:00:00 2001 From: Brett Berry Date: Wed, 2 Mar 2022 14:48:18 -0700 Subject: [PATCH 06/19] Trying different linting action --- .github/workflows/lint.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8f7ad08..91059ef 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,6 +13,8 @@ jobs: steps: - name: Code Checkout uses: actions/checkout@v1 + - name: Install markupsafe + run: pip install markupsafe==2.0.1 - name: Run flake8 uses: grantmcconnaughey/lintly-flake8-github-action@v1.0 with: From c8ced6e438204dffc9fe55fd86ef3e15696678a0 Mon Sep 17 00:00:00 2001 From: Brett Berry Date: Wed, 2 Mar 2022 15:00:07 -0700 Subject: [PATCH 07/19] Trying different linting action --- .github/workflows/lint.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 91059ef..fd211fb 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,10 +11,17 @@ jobs: flake8_py3: runs-on: ubuntu-latest steps: + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + architecture: 'x64' - name: Code Checkout uses: actions/checkout@v1 - name: Install markupsafe run: pip install markupsafe==2.0.1 + - name: Install Jinja2 + run: pip install Jinja2==2.11.3 - name: Run flake8 uses: grantmcconnaughey/lintly-flake8-github-action@v1.0 with: From e956bb6f1f2766cf1472c9edd3aae634b70f6bdf Mon Sep 17 00:00:00 2001 From: Brett Berry Date: Wed, 2 Mar 2022 15:05:14 -0700 Subject: [PATCH 08/19] Trying different linting action --- .github/workflows/lint.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fd211fb..6a80ecc 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,8 +18,10 @@ jobs: architecture: 'x64' - name: Code Checkout uses: actions/checkout@v1 + - name: Install flake8 + run: pip install flake8==4.0.1 - name: Install markupsafe - run: pip install markupsafe==2.0.1 + run: pip install MarkupSafe==2.0.1 - name: Install Jinja2 run: pip install Jinja2==2.11.3 - name: Run flake8 From 60c7f254f1e16e034c169175f26ce2fd402953e2 Mon Sep 17 00:00:00 2001 From: Brett Berry Date: Wed, 2 Mar 2022 15:19:59 -0700 Subject: [PATCH 09/19] Running lintly straight up --- .github/workflows/lint.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6a80ecc..3d07025 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,22 +11,17 @@ jobs: flake8_py3: runs-on: ubuntu-latest steps: + - name: Code Checkout + uses: actions/checkout@v2 - name: Setup Python uses: actions/setup-python@v2 with: python-version: '3.8' architecture: 'x64' - - name: Code Checkout - uses: actions/checkout@v1 - - name: Install flake8 - run: pip install flake8==4.0.1 - - name: Install markupsafe - run: pip install MarkupSafe==2.0.1 - - name: Install Jinja2 - run: pip install Jinja2==2.11.3 - - name: Run flake8 - uses: grantmcconnaughey/lintly-flake8-github-action@v1.0 + - name: Install dependencies + run: pip install lintly flake8 + - name: Lint with flake8 + uses: flake8 | lintly with: - failIf: any - token: ${{ secrets.GITHUB_TOKEN }} + LINTLY_API_KEY: ${{ secrets.GITHUB_TOKEN }} args: "--ignore=E121,E123 ." \ No newline at end of file From 570dd436f76202d1d7bf4a98ce44da15ce0d4a49 Mon Sep 17 00:00:00 2001 From: Brett Berry Date: Wed, 2 Mar 2022 15:21:27 -0700 Subject: [PATCH 10/19] Fix wrong directive --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3d07025..6a11e40 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,7 +21,7 @@ jobs: - name: Install dependencies run: pip install lintly flake8 - name: Lint with flake8 - uses: flake8 | lintly + run: flake8 | lintly with: LINTLY_API_KEY: ${{ secrets.GITHUB_TOKEN }} args: "--ignore=E121,E123 ." \ No newline at end of file From a7857abad0b9bda6fb9e5cbebbb9b71d2025bc2b Mon Sep 17 00:00:00 2001 From: Brett Berry Date: Wed, 2 Mar 2022 15:22:28 -0700 Subject: [PATCH 11/19] Replaced with directive with env --- .github/workflows/lint.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6a11e40..7663c25 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,6 +22,5 @@ jobs: run: pip install lintly flake8 - name: Lint with flake8 run: flake8 | lintly - with: - LINTLY_API_KEY: ${{ secrets.GITHUB_TOKEN }} - args: "--ignore=E121,E123 ." \ No newline at end of file + env: + LINTLY_API_KEY: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From cb100ecb06fcc874a2f585368de905bf15b816b9 Mon Sep 17 00:00:00 2001 From: Brett Berry Date: Wed, 2 Mar 2022 15:26:27 -0700 Subject: [PATCH 12/19] Still raising MarkupSafe error --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7663c25..f5664df 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,7 +19,7 @@ jobs: python-version: '3.8' architecture: 'x64' - name: Install dependencies - run: pip install lintly flake8 + run: pip install lintly flake8 MarkupSafe==2.0.1 Jinja2==2.11.3 - name: Lint with flake8 run: flake8 | lintly env: From 09ae47a93408b85e589dec7a75cca9652b57450f Mon Sep 17 00:00:00 2001 From: Brett Berry Date: Wed, 2 Mar 2022 15:29:09 -0700 Subject: [PATCH 13/19] MarkupSafe is still at 2.1.0 --- .github/workflows/lint.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f5664df..28dc9b4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,7 +19,9 @@ jobs: python-version: '3.8' architecture: 'x64' - name: Install dependencies - run: pip install lintly flake8 MarkupSafe==2.0.1 Jinja2==2.11.3 + run: pip install lintly flake8 + - name: Install problem dependencies + run: pip install MarkupSafe==2.0.1 Jinja2==2.11.3 - name: Lint with flake8 run: flake8 | lintly env: From dbef7a86ce562c2a1d2aee499f5e94e223f015a2 Mon Sep 17 00:00:00 2001 From: Brett Berry Date: Wed, 2 Mar 2022 15:40:26 -0700 Subject: [PATCH 14/19] Finally linting seems to work --- .flake8 | 5 +++++ junk.txt | 28 ++++++++++++++++++++++++++++ main.py | 11 ++++++++--- requirements.txt | 6 ++++++ 4 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 .flake8 create mode 100644 junk.txt create mode 100644 requirements.txt diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..5b447c0 --- /dev/null +++ b/.flake8 @@ -0,0 +1,5 @@ +[flake8] +max-line-length = 88 +select = B,C,E,F,W,T4,B9 +ignore = E203, E221, E231, E266, E401, E402, E501, E711, E712, E722, E741, F403, F405, F812, F841, W503, W504, W605 +exclude = jinja2,markupsafe,\.git.*,__pycache__,tests \ No newline at end of file diff --git a/junk.txt b/junk.txt new file mode 100644 index 0000000..8c4b217 --- /dev/null +++ b/junk.txt @@ -0,0 +1,28 @@ +name: Lint # name of the action (displayed in the github interface) + +on: # event list + pull_request: # on a pull request to each of these branches + branches: + - develop + paths: + - '*.py' + +jobs: + flake8_py3: + runs-on: ubuntu-latest + steps: + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified + - name: Code Checkout + uses: actions/checkout@v2 + - name: Install flake8 + run: pip install flake8 + - name: Run flake8 + uses: suo/flake8-github-action@releases/v1 + with: + checkName: 'flake8_py3' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/main.py b/main.py index 6b961fa..eb47e17 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,11 @@ class Main: - def __init__(self): - print("In Constructor") + const1 = 1 + CONST2 = 2 + + def __init__( self ): + print( "In Constructor") def do_something(self): - print(f"Let's do something!") + print("Let's do something!" ) + if self.CONST2: + print("CONST2 is set") diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..965f0c5 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +flake8==4.0.1 +Jinja2==2.11.3 +MarkupSafe==2.0.1 +mccabe==0.6.1 +pycodestyle==2.8.0 +pyflakes==2.4.0 \ No newline at end of file From 4bc3d9189dbde3cb200152d611fcebde174c1d55 Mon Sep 17 00:00:00 2001 From: Brett Berry Date: Wed, 2 Mar 2022 15:50:57 -0700 Subject: [PATCH 15/19] Fixed the one issue lintly found --- .github/workflows/{lint.yml => lint.yaml} | 8 +++++--- main.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) rename .github/workflows/{lint.yml => lint.yaml} (77%) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yaml similarity index 77% rename from .github/workflows/lint.yml rename to .github/workflows/lint.yaml index 28dc9b4..e7d79db 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yaml @@ -4,8 +4,6 @@ on: # event list pull_request: # on a pull request to each of these branches branches: - develop - paths: - - '*.py' jobs: flake8_py3: @@ -23,6 +21,10 @@ jobs: - name: Install problem dependencies run: pip install MarkupSafe==2.0.1 Jinja2==2.11.3 - name: Lint with flake8 - run: flake8 | lintly + run: flake8 | lintly --exit-zero + env: + LINTLY_API_KEY: ${{ secrets.GITHUB_TOKEN }} + - name: Lint with black + run: black . --check 2>&1 >/dev/null | lintly --exit-zero env: LINTLY_API_KEY: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/main.py b/main.py index eb47e17..225a58d 100644 --- a/main.py +++ b/main.py @@ -1,5 +1,5 @@ class Main: - const1 = 1 + const1 = 1 CONST2 = 2 def __init__( self ): From e5f8b4a0b8f96f7193544f11c5eb128dda89a349 Mon Sep 17 00:00:00 2001 From: Brett Berry Date: Wed, 2 Mar 2022 15:52:18 -0700 Subject: [PATCH 16/19] Forgot to install black --- .github/workflows/lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index e7d79db..de29844 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -17,7 +17,7 @@ jobs: python-version: '3.8' architecture: 'x64' - name: Install dependencies - run: pip install lintly flake8 + run: pip install lintly flake8 black - name: Install problem dependencies run: pip install MarkupSafe==2.0.1 Jinja2==2.11.3 - name: Lint with flake8 From 881271e66e5276f6fdef1a368feb3b7485ef2878 Mon Sep 17 00:00:00 2001 From: Brett Berry Date: Wed, 2 Mar 2022 16:00:18 -0700 Subject: [PATCH 17/19] Need to pin black --- .github/workflows/lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index de29844..725037c 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -17,7 +17,7 @@ jobs: python-version: '3.8' architecture: 'x64' - name: Install dependencies - run: pip install lintly flake8 black + run: pip install lintly flake8==3.9.2 black==21.9b0 - name: Install problem dependencies run: pip install MarkupSafe==2.0.1 Jinja2==2.11.3 - name: Lint with flake8 From d490a8683930be44cd044f5a7f234f3d332a3fd4 Mon Sep 17 00:00:00 2001 From: Brett Berry Date: Wed, 2 Mar 2022 16:02:37 -0700 Subject: [PATCH 18/19] Pinning lintly to 0.6.0 --- .github/workflows/lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 725037c..3de7f76 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -17,7 +17,7 @@ jobs: python-version: '3.8' architecture: 'x64' - name: Install dependencies - run: pip install lintly flake8==3.9.2 black==21.9b0 + run: pip install lintly==0.6.0 flake8==3.9.2 black==21.9b0 - name: Install problem dependencies run: pip install MarkupSafe==2.0.1 Jinja2==2.11.3 - name: Lint with flake8 From 8bccd6f2acccdf537d0e36b15e9fa9e60ea1ca34 Mon Sep 17 00:00:00 2001 From: Brett Berry Date: Wed, 2 Mar 2022 16:09:21 -0700 Subject: [PATCH 19/19] Lintly is no longer commenting issues on PR --- .github/workflows/lint.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 3de7f76..92a65b6 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -21,10 +21,10 @@ jobs: - name: Install problem dependencies run: pip install MarkupSafe==2.0.1 Jinja2==2.11.3 - name: Lint with flake8 - run: flake8 | lintly --exit-zero + run: flake8 | lintly --format=flake8 env: LINTLY_API_KEY: ${{ secrets.GITHUB_TOKEN }} - name: Lint with black - run: black . --check 2>&1 >/dev/null | lintly --exit-zero + run: black . --check 2>&1 >/dev/null | lintly --format=black env: LINTLY_API_KEY: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file