Skip to content

Commit b00e5eb

Browse files
committed
chore(config): standardize YAML configurations and improve readability
- Added YAML document start indicators to various configuration files for consistency. - Updated list formatting in `.pre-commit-config.yaml`, `.docker-compose.yml`, and other YAML files to use inline array syntax for improved clarity. - Enhanced the `.codecov.yml` and `.markdownlint.yaml` files by consolidating ignore patterns and default settings. - Refined the GitHub Actions workflow files to streamline job dependencies and trigger conditions. - Improved organization and readability across multiple configuration files, ensuring a more maintainable codebase.
1 parent be5fb5f commit b00e5eb

File tree

22 files changed

+251
-178
lines changed

22 files changed

+251
-178
lines changed

.codecov.yml

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
# ==============================================================================
23
# TUX DISCORD BOT - CODECOV CONFIGURATION
34
# ==============================================================================
@@ -90,8 +91,7 @@ coverage:
9091
target: 80%
9192
threshold: 2% # Stricter threshold for critical code
9293
informational: true # Don't block PRs while building up test suite
93-
flags: # Covered by main unit test suite
94-
- unit
94+
flags: [unit] # Covered by main unit test suite
9595
paths:
9696
- tux/bot.py # Main bot class and Discord client setup
9797
- tux/cog_loader.py # Extension loading and management
@@ -107,9 +107,7 @@ coverage:
107107
target: 90%
108108
threshold: 1% # Very strict threshold for data operations
109109
informational: true # Don't block PRs while building up test suite
110-
flags: # Covered by both unit and database-specific tests
111-
- unit
112-
- database
110+
flags: [unit, database] # Covered by both unit and database-specific tests
113111
paths:
114112
- tux/database/**/* # All database controllers, models, and utilities
115113
only_pulls: true
@@ -121,8 +119,7 @@ coverage:
121119
target: 75%
122120
threshold: 2%
123121
informational: true # Don't block PRs while building up test suite
124-
flags:
125-
- unit
122+
flags: [unit]
126123
paths:
127124
- tux/modules/**/* # All command modules and Discord slash commands
128125
only_pulls: true
@@ -134,8 +131,7 @@ coverage:
134131
target: 70%
135132
threshold: 3% # More lenient for utility functions
136133
informational: true # Don't block PRs while building up test suite
137-
flags:
138-
- unit
134+
flags: [unit]
139135
paths:
140136
- tux/utils/**/* # Configuration, helpers, constants, etc.
141137
only_pulls: true
@@ -147,8 +143,7 @@ coverage:
147143
target: 65%
148144
threshold: 3%
149145
informational: true # Don't block PRs while building up test suite
150-
flags:
151-
- unit
146+
flags: [unit]
152147
paths:
153148
- tux/cli/**/* # Development and management CLI tools
154149
only_pulls: true
@@ -160,8 +155,7 @@ coverage:
160155
target: 80%
161156
threshold: 2%
162157
informational: true # Don't block PRs while building up test suite
163-
flags:
164-
- unit
158+
flags: [unit]
165159
paths:
166160
- tux/handlers/**/* # Error handlers, event processors, activity handlers
167161
only_pulls: true
@@ -173,8 +167,7 @@ coverage:
173167
target: 70%
174168
threshold: 3%
175169
informational: true # Don't block PRs while building up test suite
176-
flags:
177-
- unit
170+
flags: [unit]
178171
paths:
179172
- tux/ui/**/* # Discord embeds, buttons, modals, views
180173
only_pulls: true
@@ -186,8 +179,7 @@ coverage:
186179
target: 60%
187180
threshold: 4% # Most lenient threshold due to external dependencies
188181
informational: true # Don't block PRs while building up test suite
189-
flags:
190-
- unit
182+
flags: [unit]
191183
paths:
192184
- tux/wrappers/**/* # GitHub, XKCD, Godbolt, and other API wrappers
193185
only_pulls: true
@@ -216,8 +208,7 @@ coverage:
216208
target: 95%
217209
threshold: 2% # Very strict for new database operations
218210
informational: true # Don't block PRs while building up test suite
219-
flags:
220-
- database
211+
flags: [database]
221212
paths:
222213
- tux/database/**/*
223214

@@ -227,8 +218,7 @@ coverage:
227218
target: 90%
228219
threshold: 3%
229220
informational: true # Don't block PRs while building up test suite
230-
flags:
231-
- unit
221+
flags: [unit]
232222
paths:
233223
- tux/bot.py
234224
- tux/cog_loader.py
@@ -240,8 +230,7 @@ coverage:
240230
target: 90%
241231
threshold: 3%
242232
informational: true # Don't block PRs while building up test suite
243-
flags:
244-
- unit
233+
flags: [unit]
245234
paths:
246235
- tux/handlers/**/*
247236
# ==============================================================================
@@ -331,8 +320,7 @@ component_management:
331320
# DEFAULT COMPONENT RULES
332321
# Applied to all components unless overridden
333322
default_rules:
334-
flag_regexes: # Most components covered by unit tests
335-
- unit
323+
flag_regexes: [unit] # Most components covered by unit tests
336324
statuses:
337325
- type: project
338326
target: auto # Progressive improvement for all components
@@ -360,12 +348,10 @@ component_management:
360348
name: Database Layer
361349
paths:
362350
- tux/database/**/* # Controllers, models, client, and utilities
363-
flag_regexes: # Covered by both unit and DB-specific tests
351+
flag_regexes: [unit, database] # Covered by both unit and DB-specific tests
364352

365353
# BOT COMMANDS AND FEATURES COMPONENT
366354
# User-facing Discord commands and integrations
367-
- unit
368-
- database
369355
- component_id: modules
370356
name: Bot Commands & Features
371357
paths:
@@ -439,22 +425,19 @@ flag_management:
439425
# UNIT TESTS FLAG
440426
# Main test suite covering individual functions and classes
441427
- name: unit
442-
paths: # Covers all application code
443-
- tux/
428+
paths: [tux/] # Covers all application code
444429
carryforward: true
445430

446431
# DATABASE TESTS FLAG
447432
# Specific tests for database operations and data integrity
448433
- name: database
449-
paths: # Only covers database-related code
450-
- tux/database/**/*
434+
paths: [tux/database/**/*] # Only covers database-related code
451435
carryforward: true
452436

453437
# INTEGRATION TESTS FLAG
454438
# End-to-end tests covering full user workflows
455439
- name: integration
456-
paths: # Covers all application code in integrated scenarios
457-
- tux/
440+
paths: [tux/] # Covers all application code in integrated scenarios
458441
carryforward: true
459442
# ==============================================================================
460443
# ADVANCED CODECOV SETTINGS

.github/actions/action-basedpyright/action.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: action-basedpyright
23
description: Run basedpyright with reviewdog on pull requests to improve code review
34
experience
@@ -8,7 +9,7 @@ inputs:
89
workdir:
910
description: Working directory relative to the root directory.
1011
default: .
11-
### Flags for reviewdog ###
12+
### Flags for reviewdog ###
1213
tool_name:
1314
description: Tool name to use for reviewdog reporter.
1415
default: basedpyright
@@ -32,7 +33,7 @@ inputs:
3233
reviewdog_flags:
3334
description: Additional reviewdog flags.
3435
default: ''
35-
### Flags for basedpyright ###
36+
### Flags for basedpyright ###
3637
basedpyright_flags:
3738
description: Additional flags for basedpyright command.
3839
default: --outputjson

.github/actions/create-test-env/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Create Test Environment
23
description: Create .env file with test configuration for CI/testing purposes
34
inputs:

.github/actions/setup-python/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Setup Python Environment
23
description: Set up Python with Uv and dependencies
34
inputs:

.github/workflows/ci.yml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1+
---
12
name: CI
23
on:
34
push:
4-
branches:
5-
- main
5+
branches: [main]
66
pull_request:
7-
branches:
8-
- main
7+
branches: [main]
98
workflow_dispatch:
109
concurrency:
1110
group: ${{ github.workflow }}-${{ github.ref }}
@@ -106,8 +105,7 @@ jobs:
106105
quality:
107106
name: Python
108107
runs-on: ubuntu-latest
109-
needs:
110-
- changes
108+
needs: [changes]
111109
if: needs.changes.outputs.python == 'true' || github.event_name == 'workflow_dispatch'
112110
permissions:
113111
contents: read
@@ -150,8 +148,7 @@ jobs:
150148
markdown:
151149
name: Markdown
152150
runs-on: ubuntu-latest
153-
needs:
154-
- changes
151+
needs: [changes]
155152
if: needs.changes.outputs.markdown == 'true'
156153
permissions:
157154
contents: read
@@ -170,8 +167,7 @@ jobs:
170167
shell:
171168
name: Shell
172169
runs-on: ubuntu-latest
173-
needs:
174-
- changes
170+
needs: [changes]
175171
if: needs.changes.outputs.shell == 'true'
176172
permissions:
177173
contents: read
@@ -197,8 +193,7 @@ jobs:
197193
workflows:
198194
name: Workflows
199195
runs-on: ubuntu-latest
200-
needs:
201-
- changes
196+
needs: [changes]
202197
if: needs.changes.outputs.workflows == 'true'
203198
permissions:
204199
contents: read
@@ -217,8 +212,7 @@ jobs:
217212
docker:
218213
name: Docker
219214
runs-on: ubuntu-latest
220-
needs:
221-
- changes
215+
needs: [changes]
222216
if: needs.changes.outputs.docker == 'true'
223217
permissions:
224218
contents: read
@@ -238,8 +232,7 @@ jobs:
238232
yaml:
239233
name: YAML
240234
runs-on: ubuntu-latest
241-
needs:
242-
- changes
235+
needs: [changes]
243236
if: needs.changes.outputs.yaml == 'true'
244237
permissions:
245238
contents: read
@@ -258,8 +251,7 @@ jobs:
258251
security:
259252
name: Security
260253
runs-on: ubuntu-latest
261-
needs:
262-
- changes
254+
needs: [changes]
263255
if: always()
264256
permissions:
265257
contents: read

.github/workflows/deploy.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1+
---
12
name: Deploy
23
on:
34
release:
4-
types:
5-
- published
5+
types: [published]
66
workflow_dispatch:
77
inputs:
88
environment:
99
description: Environment to deploy to
1010
required: true
1111
type: choice
12-
options:
13-
- staging
14-
- production
12+
options: [staging, production]
1513
default: staging
1614
concurrency:
1715
group: deploy-${{ github.event.inputs.environment || 'production' }}

.github/workflows/docker.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1+
---
12
name: Docker
23
on:
34
push:
4-
tags:
5-
- v*
5+
tags: [v*]
66
pull_request:
7-
branches:
8-
- main
7+
branches: [main]
98
workflow_dispatch:
109
schedule:
1110
- cron: 0 2 15 * *
@@ -97,8 +96,7 @@ jobs:
9796
build:
9897
name: Build & Push
9998
runs-on: ubuntu-latest
100-
needs:
101-
- validate
99+
needs: [validate]
102100
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
103101
permissions:
104102
contents: read

.github/workflows/maintenance.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
---
12
name: Maintenance
23
on:
34
push:
4-
branches:
5-
- main
5+
branches: [main]
66
workflow_dispatch:
77
inputs:
88
cleanup_images:

.github/workflows/release.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
---
12
name: Release
23
on:
34
push:
4-
tags:
5-
- v*
5+
tags: [v*]
66
workflow_dispatch:
77
inputs:
88
version:
@@ -58,9 +58,7 @@ jobs:
5858
create:
5959
name: Create Release
6060
runs-on: ubuntu-latest
61-
needs:
62-
- validate
63-
- wait
61+
needs: [validate, wait]
6462
steps:
6563
- name: Checkout
6664
uses: actions/checkout@v4

.github/workflows/security.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1+
---
12
name: Security
23
on:
34
push:
4-
branches:
5-
- main
5+
branches: [main]
66
pull_request:
7-
branches:
8-
- main
7+
branches: [main]
98
schedule:
109
- cron: 20 7 * * 1
1110
concurrency:

0 commit comments

Comments
 (0)