Skip to content

Commit

Permalink
Setup flake8 CI job (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
NoharaMasato committed May 28, 2023
1 parent 3a3a1b3 commit 3a4a274
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 100
19 changes: 19 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Lint

on: [push, pull_request, workflow_dispatch]

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: "3.x"

- uses: pre-commit/action@v3.0.0
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,10 @@ repos:
hooks:
- id: tox-ini-fmt

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8

ci:
autoupdate_schedule: quarterly
6 changes: 3 additions & 3 deletions geojson/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ def createPoly():
return Polygon([points])

def clip(x, min, max):
if(min > max):
if min > max:
return x
elif(x < min):
elif x < min:
return min
elif(x > max):
elif x > max:
return max
else:
return x
Expand Down

0 comments on commit 3a4a274

Please sign in to comment.