Skip to content

Commit

Permalink
Merge pull request #90 from AnimalFoodBank/delano/2024-03-24-re-trunk
Browse files Browse the repository at this point in the history
Update Trunk CLI version, plugin refs, and linters
  • Loading branch information
delano authored Mar 25, 2024
2 parents 1a020e9 + c2a1783 commit 5ba33c0
Show file tree
Hide file tree
Showing 8 changed files with 521 additions and 41 deletions.
40 changes: 30 additions & 10 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# This is a basic GitHub Actions workflow for running CI tests on a Django project.
# It runs on Ubuntu 22.04 with 4 parallel jobs, caches system packages and Python dependencies,
# and checks out the repository with a fetch depth of 1. The build job sets the Python version to 3.11
# and runs the tests using the specified matrix. It is triggered on push or pull request events on the main branch,
# as well as manually using the workflow_dispatch event.
# For more information, see https://docs.github.com/en/actions/guides/building-and-testing-python#building-and-testing-python-with-multiple-versions

# This is a basic GitHub Actions workflow for running CI tests on a Django
# project. It runs on Ubuntu 22.04 with 4 parallel jobs, caches system
# packages and Python dependencies, and checks out the repository with a
# fetch depth of 1. The build job sets the Python version to 3.11 and runs
# the tests using the specified matrix. It is triggered on push or pull
# request events on the main branch, as well as manually using the
# workflow_dispatch event. For more information, see
# https://docs.github.com/en/actions/guides/building-and-testing-python#building-and-testing-python-with-multiple-versions
name: Django CI (basic)
on:
push:
Expand All @@ -17,10 +18,26 @@ jobs:
build:

runs-on: ubuntu-22.04
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: user
POSTGRES_PASSWORD: pass
POSTGRES_DB: afbrequests
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DATABASE_NAME: afbrequests
DATABASE_USER: user
DATABASE_PASSWORD: pass
DB_NAME: afbrequests
DB_USER: user
DB_PASSWORD: pass
DB_ENGINE: django.db.backends.postgresql
defaults:
run:
working-directory: ./apps/api
Expand Down Expand Up @@ -56,6 +73,9 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install Pillow
run: python -m pip install Pillow

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
Expand Down
12 changes: 12 additions & 0 deletions .trunk/configs/.hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Configuration for Hadolint, a Dockerfile linter.
ignored:
# SC1090: Can't follow non-constant source. This warning occurs when
# ShellCheck can't find a file that is sourced in the script. This is
# common in Dockerfiles where the sourced file is added in a different
# layer.
- SC1090
# SC1091: Not following: (file mentioned in source command). This warning
# occurs when ShellCheck can't read a file that is sourced in the script.
# This can happen even if the file exists, for example, due to
# permissions.
- SC1091
2 changes: 2 additions & 0 deletions .trunk/configs/.isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[settings]
profile=black
12 changes: 2 additions & 10 deletions .trunk/configs/.markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
# Autoformatter friendly markdownlint config (all formatting rules disabled)
default: true
blank_lines: false
bullet: false
html: false
indentation: false
line_length: false
spaces: false
url: false
whitespace: false
# Prettier friendly markdownlint config (all formatting rules disabled)
extends: markdownlint/style/prettier
2 changes: 1 addition & 1 deletion .trunk/configs/.yamllint.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
rules:
quoted-strings:
required: consistent
required: only-when-needed
extra-allowed: ["{|}"]
empty-values:
forbid-in-block-mappings: true
Expand Down
5 changes: 5 additions & 0 deletions .trunk/configs/ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Generic, formatter-friendly config.
select = ["B", "D3", "E", "F"]

# Never enforce `E501` (line length violations). This should be handled by formatters.
ignore = ["E501"]
43 changes: 23 additions & 20 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,41 @@
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
version: 0.1
cli:
version: 1.19.0
version: 1.21.0
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
plugins:
sources:
- id: trunk
ref: v1.4.2
ref: v1.4.5
uri: https://github.com/trunk-io/plugins
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
runtimes:
enabled:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
lint:
enabled:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- git-diff-check
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- git-diff-check
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
disabled:
- black
- isort
- autoflake
- [email protected]
- [email protected]
- [email protected]
- [email protected]
actions:
disabled:
- trunk-announce
Expand Down
Loading

0 comments on commit 5ba33c0

Please sign in to comment.