Skip to content

Commit

Permalink
Add minimal lint workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Mar 2, 2024
1 parent 12ed8af commit d945b26
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: lint

on:
push:
paths:
- '**.py'
- 'requirements.txt'
pull_request:
paths:
- '**.py'
- 'requirements.txt'

jobs:

pylint:
runs-on: ubuntu-latest
container:
image: python:3.11-slim
steps:
- uses: actions/checkout@v3
- name: Install deps
run: |
pip install -r requirements.txt
pip install pylint
- name: Lint
run: |
pylint -E --fail-on=E server.py
5 changes: 1 addition & 4 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ def geoip_lookup_continent(ip):

if not reader:
return
try:
geo = reader.get(ip)
except geoip2.errors.GeoIP2Error:
return
geo = reader.get(ip)

if geo and "continent" in geo:
return geo["continent"]["code"]
Expand Down

0 comments on commit d945b26

Please sign in to comment.