This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from Nukesor/tooling
Tooling
- Loading branch information
Showing
20 changed files
with
702 additions
and
326 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
paths: | ||
- ".github/**/*" | ||
- "archivebot/**" | ||
pull_request: | ||
paths: | ||
- ".github/**/*" | ||
- "archivebot/**" | ||
|
||
defaults: | ||
run: | ||
working-directory: archivebot | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
python-version: ["3.10"] | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Clone the repository | ||
uses: actions/checkout@v3 | ||
|
||
# This has been done according to https://docs.makedeb.org/prebuilt-mpr/getting-started/ | ||
# This is needed for packages: just | ||
- name: Add makedb debian user repository | ||
run: | | ||
curl -q 'https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' | gpg --dearmor | sudo tee /usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg 1> /dev/null | ||
echo "deb [signed-by=/usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg] https://proget.makedeb.org prebuilt-mpr $(lsb_release -cs)" | sudo tee /etc/apt/sources.list.d/prebuilt-mpr.list | ||
sudo apt update | ||
- name: Install dev dependencies | ||
run: sudo apt install just | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: "poetry" | ||
|
||
- name: Install Python dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: | | ||
poetry install | ||
- name: Lint | ||
run: | | ||
just lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
default: run | ||
|
||
run: | ||
poetry run python main.py run | ||
|
||
initdb *args: | ||
poetry run python main.py initdb {{ args }} | ||
|
||
setup: | ||
poetry install | ||
|
||
lint: | ||
poetry run black --check archivebot | ||
poetry run isort --check-only archivebot | ||
poetry run flake8 archivebot | ||
|
||
format: | ||
# remove unused imports | ||
poetry run autoflake \ | ||
--remove-all-unused-imports \ | ||
--recursive \ | ||
--in-place archivebot | ||
poetry run black archivebot | ||
poetry run isort archivebot | ||
|
||
|
||
# Watch for something | ||
# E.g. `just watch lint` or `just watch test` | ||
watch *args: | ||
watchexec --clear 'just {{ args }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.