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/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..92a65b6 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,30 @@ +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 + +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: Install dependencies + 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 + run: flake8 | lintly --format=flake8 + env: + LINTLY_API_KEY: ${{ secrets.GITHUB_TOKEN }} + - name: Lint with black + run: black . --check 2>&1 >/dev/null | lintly --format=black + env: + LINTLY_API_KEY: ${{ secrets.GITHUB_TOKEN }} \ 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 new file mode 100644 index 0000000..225a58d --- /dev/null +++ b/main.py @@ -0,0 +1,11 @@ +class Main: + const1 = 1 + CONST2 = 2 + + def __init__( self ): + print( "In Constructor") + + def do_something(self): + 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