Skip to content

Commit

Permalink
Introduce flak8
Browse files Browse the repository at this point in the history
This patch adds a GitHub Actions workflow which runs `flake8` as style
checker and basic static code analysis tool.

For now, this still excludes the line length check. We should get to
that eventually, but most of the warnings probably get fixed when we
address #7 and introduce a logger anyway.
  • Loading branch information
lkiesow committed Feb 8, 2024
1 parent bc99f32 commit f2ed48a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: run flake8

on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
# https://endoflife.date/python
# https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#python
python-version:
- '3.9'
- '3.10'
- '3.11'

steps:
- uses: actions/checkout@v4

- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- run: pip install -r requirements.txt

- run: pip install flake8

- run: flake8 --max-line-length 140 *.py
6 changes: 1 addition & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import argparse
import requests
import json
import time
import threading

Expand All @@ -31,10 +30,7 @@
# Works
def getCutoff():
# calculate the offset of now + 1 week
cutoff = (round(time.time()) + 7*24*60*60)*1000

#print("Cutoff =",cutoff)
return cutoff
return (int(time.time()) + 7*24*60*60)*1000


# Works fine for now
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
confygure
confygure >= 0.0.3
requests

0 comments on commit f2ed48a

Please sign in to comment.