Skip to content
This repository was archived by the owner on Jan 1, 2023. It is now read-only.

Commit e4f41bd

Browse files
committed
Add linters as Github actions
Adds linters for Python files and the changelog as Github actions
1 parent 69468d9 commit e4f41bd

File tree

7 files changed

+46
-13
lines changed

7 files changed

+46
-13
lines changed

.flake8

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
max-line-length = 120

.github/workflows/checks.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Lint
2+
on: [pull_request]
3+
jobs:
4+
Lint:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Checkout
8+
uses: actions/checkout@v2
9+
- name: Lint changelog
10+
uses: avto-dev/markdown-lint@v1
11+
with:
12+
rules: "/lint/rules/changelog.js"
13+
config: "/lint/config/changelog.yml"
14+
args: "CHANGELOG.md"
15+
- uses: ricardochaves/[email protected]
16+
with:
17+
use-pylint: false
18+
use-pycodestyle: false
19+
use-flake8: true
20+
use-black: true
21+
use-mypy: false
22+
use-isort: true

.mdl_style.rb

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
all
2+
3+
rule 'MD013', :line_length => 120, :code_blocks => false

.mdlrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
style '.mdl_style.rb'

CHANGELOG.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## Unreleased changes
3+
## UNRELEASED
44

55
- Added support for the `--debug` option to additionally print debug output
66

@@ -15,8 +15,7 @@
1515

1616
## v1.0.1
1717

18-
- Fixed a bug where the `--earliest-day` option wasn't optional,
19-
but should have been
18+
- Fixed a bug where the `--earliest-day` option wasn't optional, but should have been
2019

2120
## v1.0.0
2221

README.md

+15-9
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,47 @@
11
# ImpfChecker
22

3-
Basic checker for Bavaria's booking portal for vaccination appointments.
4-
Checks the portal for the first available appointment and prints it.
3+
Basic checker for Bavaria's booking portal for vaccination appointments.
4+
Checks the portal for the first available appointment and prints it.
55

66
## Requirements
77

8-
- You need to be registered with the portal at https://impfzentren.bayern/citizen/
8+
- You need to be registered with the [vaccination portal](https://impfzentren.bayern/citizen/)
99
- You need to have selected a vaccination centre in the portal
1010
- Python 3
1111

1212
## How to run
1313

1414
### Install the dependencies
1515

16-
Just run
16+
Just run
17+
1718
```shell
1819
pip install -r requirements.txt
1920
```
2021

2122
### Run the checker
2223

2324
The checker requires your username, password, and citizen ID.
24-
You can find your citizen ID if you login to the portal and select the person. The address bar in your browser contains
25-
the ID in the following format: `https://impfzentren.bayern/citizen/overview/{CITIZEN_ID}`.
25+
You can find your citizen ID if you login to the portal and select the person.
26+
The address bar in your browser contains the ID in the following format:
27+
`https://impfzentren.bayern/citizen/overview/{CITIZEN_ID}`.
2628

2729
Minimal example to find the next available appointment:
30+
2831
```shell
2932
python impf.py --citizen-id=AAAAAAAA-0000-0000-0000-AAAAAAAAAAAA [email protected] --password=my_password
3033
```
3134

32-
You can additionally pass `--earliest-day` with the earliest acceptable date, which restricts the search to appointments after that date:
35+
You can additionally pass `--earliest-day` with the earliest acceptable date,
36+
which restricts the search to appointments after that date:
37+
3338
```shell
3439
python impf.py --citizen-id=AAAAAAAA-0000-0000-0000-AAAAAAAAAAAA [email protected] --password=my_password --earliest-day=2021-12-24
3540
```
3641

37-
Full help:
38-
```
42+
Full help:
43+
44+
```text
3945
$ python impf.py -h Py byImpf 14:25:01
4046
usage: impf.py [-h] --citizen-id CITIZEN_ID --email EMAIL --password PASSWORD [--earliest-day EARLIEST_DAY] [--latest-day LATEST_DAY] [--interval INTERVAL] [--book | --no-book]
4147

impf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ def _book(self, payload: Dict[str, Union[str, Dict[str, bool]]]) -> bool:
312312
)
313313

314314
if book_rsp.status_code != 200:
315-
logging.error(f"Error booking appointment. Status %d", book_rsp.status_code)
315+
logging.error("Error booking appointment. Status %s", book_rsp.status_code)
316316
return False
317317

318318
logging.info("Appointment booked.")

0 commit comments

Comments
 (0)