Update: Major code refactor for modular extensibility #2
@@ -70,6 +70,9 @@ jobs:
|
|||||||
PanelURL = https://panel.example.com
|
PanelURL = https://panel.example.com
|
||||||
ClientAPIKey = ptlc_test_client_key_123456789
|
ClientAPIKey = ptlc_test_client_key_123456789
|
||||||
ApplicationAPIKey = ptla_test_app_key_987654321
|
ApplicationAPIKey = ptla_test_app_key_987654321
|
||||||
|
# Pelican Panel test keys
|
||||||
|
# ClientAPIKey = pacc_test_client_key_123456789
|
||||||
|
# ApplicationAPIKey = papp_test_app_key_987654321
|
||||||
|
|
||||||
[Discord]
|
[Discord]
|
||||||
Token = test_discord_token_placeholder
|
Token = test_discord_token_placeholder
|
||||||
@@ -81,8 +84,13 @@ jobs:
|
|||||||
python -m pytest test_pterodisbot.py \
|
python -m pytest test_pterodisbot.py \
|
||||||
-v \
|
-v \
|
||||||
--tb=short \
|
--tb=short \
|
||||||
--cov=pterodisbot \
|
--cov=config \
|
||||||
--cov=server_metrics_graphs \
|
--cov=api \
|
||||||
|
--cov=embeds \
|
||||||
|
--cov=views \
|
||||||
|
--cov=bot \
|
||||||
|
--cov=metrics \
|
||||||
|
--cov=models \
|
||||||
--cov-report=xml \
|
--cov-report=xml \
|
||||||
--cov-report=term \
|
--cov-report=term \
|
||||||
--cov-report=html \
|
--cov-report=html \
|
||||||
@@ -129,7 +137,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Run flake8
|
- name: Run flake8
|
||||||
run: |
|
run: |
|
||||||
flake8 pterodisbot.py server_metrics_graphs.py \
|
flake8 config.py api.py embeds.py views.py bot.py metrics.py models.py \
|
||||||
--max-line-length=140 \
|
--max-line-length=140 \
|
||||||
--ignore=E501,W503,E203 \
|
--ignore=E501,W503,E203 \
|
||||||
--exclude=venv,__pycache__,build,dist \
|
--exclude=venv,__pycache__,build,dist \
|
||||||
@@ -139,7 +147,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Run pylint
|
- name: Run pylint
|
||||||
run: |
|
run: |
|
||||||
pylint pterodisbot.py server_metrics_graphs.py \
|
pylint config.py api.py embeds.py views.py bot.py metrics.py models.py \
|
||||||
--disable=C0111,C0103,R0913,R0914,R0915,W0718 \
|
--disable=C0111,C0103,R0913,R0914,R0915,W0718 \
|
||||||
--max-line-length=140 \
|
--max-line-length=140 \
|
||||||
--output-format=text \
|
--output-format=text \
|
||||||
@@ -148,17 +156,17 @@ jobs:
|
|||||||
|
|
||||||
- name: Check code formatting with black
|
- name: Check code formatting with black
|
||||||
run: |
|
run: |
|
||||||
black --check --line-length=140 --diff pterodisbot.py server_metrics_graphs.py | tee black-report.txt
|
black --check --line-length=140 --diff config.py api.py embeds.py views.py bot.py metrics.py models.py | tee black-report.txt
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Check import ordering
|
- name: Check import ordering
|
||||||
run: |
|
run: |
|
||||||
isort --check-only --profile black --line-length=140 pterodisbot.py server_metrics_graphs.py
|
isort --check-only --profile black --line-length=140 config.py api.py embeds.py views.py bot.py metrics.py models.py
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Type checking with mypy
|
- name: Type checking with mypy
|
||||||
run: |
|
run: |
|
||||||
mypy pterodisbot.py server_metrics_graphs.py --ignore-missing-imports > mypy-report.txt || true
|
mypy config.py api.py embeds.py views.py bot.py metrics.py models.py --ignore-missing-imports > mypy-report.txt || true
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Upload linting reports
|
- name: Upload linting reports
|
||||||
@@ -203,7 +211,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Run bandit security scan
|
- name: Run bandit security scan
|
||||||
run: |
|
run: |
|
||||||
bandit -r . \
|
bandit -r config.py api.py embeds.py views.py bot.py metrics.py models.py \
|
||||||
-f json \
|
-f json \
|
||||||
-o bandit-report.json \
|
-o bandit-report.json \
|
||||||
-ll \
|
-ll \
|
||||||
@@ -273,6 +281,9 @@ jobs:
|
|||||||
PanelURL = https://panel.example.com
|
PanelURL = https://panel.example.com
|
||||||
ClientAPIKey = ptlc_test_client_key_123456789
|
ClientAPIKey = ptlc_test_client_key_123456789
|
||||||
ApplicationAPIKey = ptla_test_app_key_987654321
|
ApplicationAPIKey = ptla_test_app_key_987654321
|
||||||
|
# Pelican Panel test keys
|
||||||
|
# ClientAPIKey = pacc_test_client_key_123456789
|
||||||
|
# ApplicationAPIKey = papp_test_app_key_987654321
|
||||||
|
|
||||||
[Discord]
|
[Discord]
|
||||||
Token = test_discord_token_placeholder
|
Token = test_discord_token_placeholder
|
||||||
|
|||||||
Reference in new issue
Block a user