Skip to content

Commit

Permalink
Add code style check and fix commands
Browse files Browse the repository at this point in the history
Add code style check and fix commands
  • Loading branch information
nickspaargaren committed Aug 14, 2024
1 parent b39823e commit 1a3f738
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 16 deletions.
39 changes: 25 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,55 @@
name: Tests
on: push
jobs:
code-style:
name: Code style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
cache: 'pip'
- run: pip install -r requirements.txt
- name: Check
run: black . --check

duplicates:
name: No duplicate domains in list
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v2
name: Python setup
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install pytest
run: pip install pytest
cache: 'pip'
- run: pip install -r requirements.txt
- name: Check for duplicate lines
run: |
cd scripts
python3 tests.py --type duplicates
regex:
name: No regex domains in list
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v2
name: Python setup
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install pytest
run: pip install pytest
cache: 'pip'
- run: pip install -r requirements.txt
- name: Check if list includes regex domains
run: |
cd scripts
python3 tests.py --type regex
unbound:
name: Check Unbound list
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Unbound
run: sudo apt-get update && sudo apt-get install -y unbound
- name: Check unbound list
run: unbound-checkconf unbound.conf
run: unbound-checkconf unbound.conf
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ whois: ## Check all domains with whois
@. .venv/bin/activate; cd scripts && python domain-check-api.py

dnscheck: ## Check all domains if they have a response
@. .venv/bin/activate; cd scripts && python dnscheck.py
@. .venv/bin/activate; cd scripts && python dnscheck.py

codestyle-check: ## Check all Python scripts code style
@. .venv/bin/activate; black . --check

codestyle-fix: ## Fix all Python scripts code style
@. .venv/bin/activate; black .
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
black==24.8.0
python-whois==0.9.4
dnspython==2.6.1
dnspython==2.6.1
pytest==8.3.2

0 comments on commit 1a3f738

Please sign in to comment.