Skip to content

Commit 6abffdc

Browse files
authored
Merge branch 'main' into example-cog
2 parents b11f0f6 + 402986b commit 6abffdc

File tree

148 files changed

+17575
-4508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+17575
-4508
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

tux/cogs/utility/snippets.py renamed to .archive/snippets.py

Lines changed: 307 additions & 186 deletions
Large diffs are not rendered by default.
File renamed without changes.
File renamed without changes.

.cursorrules

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
{
2+
"rules": [
3+
{
4+
"name": "Verify Information",
5+
"pattern": "(?i)\\b(assume|assumption|guess|speculate)\\b",
6+
"message": "Always verify information before presenting it. Do not make assumptions or speculate without clear evidence."
7+
},
8+
{
9+
"name": "Preserve Existing Code",
10+
"pattern": "(?i)\\b(remove|delete|eliminate|destroy)\\b",
11+
"message": "Don't remove unrelated code or functionalities. Pay attention to preserving existing structures."
12+
},
13+
{
14+
"name": "No Apologies",
15+
"pattern": "(?i)\\b(sorry|apologize|apologies)\\b",
16+
"message": "Never use apologies."
17+
},
18+
{
19+
"name": "No Understanding Feedback",
20+
"pattern": "(?i)\\b(understand|understood|got it)\\b",
21+
"message": "Avoid giving feedback about understanding in comments or documentation."
22+
},
23+
{
24+
"name": "No Whitespace Suggestions",
25+
"pattern": "(?i)\\b(whitespace|indentation|spacing)\\b",
26+
"message": "Don't suggest whitespace changes."
27+
},
28+
{
29+
"name": "No Summaries",
30+
"pattern": "(?i)\\b(summary|summarize|overview)\\b",
31+
"message": "Don't summarize changes made."
32+
},
33+
{
34+
"name": "No Inventions",
35+
"pattern": "(?i)\\b(suggest|recommendation|propose)\\b",
36+
"message": "Don't invent changes other than what's explicitly requested."
37+
},
38+
{
39+
"name": "No Unnecessary Confirmations",
40+
"pattern": "(?i)\\b(make sure|confirm|verify|check)\\b",
41+
"message": "Don't ask for confirmation of information already provided in the context."
42+
},
43+
{
44+
"name": "Single Chunk Edits",
45+
"pattern": "(?i)\\b(first|then|next|after that|finally)\\b",
46+
"message": "Provide all edits in a single chunk instead of multiple-step instructions or explanations for the same file."
47+
},
48+
{
49+
"name": "No Implementation Checks",
50+
"pattern": "(?i)\\b(make sure|verify|check|confirm) (it's|it is|that) (correctly|properly) implemented\\b",
51+
"message": "Don't ask the user to verify implementations that are visible in the provided context."
52+
},
53+
{
54+
"name": "No Unnecessary Updates",
55+
"pattern": "(?i)\\b(update|change|modify|alter)\\b.*\\bno changes\\b",
56+
"message": "Don't suggest updates or changes to files when there are no actual modifications needed."
57+
},
58+
{
59+
"name": "Provide Real File Links",
60+
"pattern": "(?i)\\b(file|in)\\b.*\\b(x\\.md)\\b",
61+
"message": "Always provide links to the real files, not x.md."
62+
},
63+
{
64+
"name": "No Current Implementation",
65+
"pattern": "(?i)\\b(current|existing)\\s+(implementation|code)\\b",
66+
"message": "Don't show or discuss the current implementation unless specifically requested."
67+
},
68+
{
69+
"name": "Check Context Generated File Content",
70+
"pattern": "(?i)\\b(file|content|implementation)\\b",
71+
"message": "Remember to check the context generated file for the current file contents and implementations."
72+
},
73+
{
74+
"name": "Use Descriptive Variable Names",
75+
"pattern": "(?i)\\b(var|x|temp)\\b",
76+
"message": "Prefer descriptive, explicit variable names over short, ambiguous ones to enhance code readability."
77+
},
78+
{
79+
"name": "Follow Consistent Coding Style",
80+
"pattern": "(?i)\\b(not consistent|different style)\\b",
81+
"message": "Adhere to the existing coding style in the project for consistency."
82+
},
83+
{
84+
"name": "Prioritize Performance",
85+
"pattern": "(?i)\\b(slow|inefficient)\\b",
86+
"message": "When suggesting changes, consider and prioritize code performance where applicable."
87+
},
88+
{
89+
"name": "Security-First Approach",
90+
"pattern": "(?i)\\b(insecure|vulnerable)\\b",
91+
"message": "Always consider security implications when modifying or suggesting code changes."
92+
},
93+
{
94+
"name": "Error Handling",
95+
"pattern": "(?i)\\b(missing error|no exception)\\b",
96+
"message": "Implement robust error handling and logging where necessary."
97+
},
98+
{
99+
"name": "Modular Design",
100+
"pattern": "(?i)\\b(mixed responsibilities|not modular)\\b",
101+
"message": "Encourage modular design principles to improve code maintainability and reusability."
102+
},
103+
{
104+
"name": "Avoid Magic Numbers",
105+
"pattern": "(?i)\\b\\b\\d{2,}\\b",
106+
"message": "Replace hardcoded values with named constants to improve code clarity and maintainability."
107+
},
108+
{
109+
"name": "Consider Edge Cases",
110+
"pattern": "(?i)\\b(edge case|not handled)\\b",
111+
"message": "When implementing logic, always consider and handle potential edge cases."
112+
},
113+
{
114+
"name": "Use Assertions",
115+
"pattern": "(?i)\\b(no assertion|missing assert)\\b",
116+
"message": "Include assertions wherever possible to validate assumptions and catch potential errors early."
117+
}
118+
],
119+
"coding_practices": {
120+
"modularity": true,
121+
"DRY_principle": true,
122+
"performance_optimization": true,
123+
"documentation": {
124+
"require_docs": true,
125+
"doc_tool": "docstrings",
126+
"style_guide": "Numpy"
127+
},
128+
"error_handling": {
129+
"prefer_try_catch": true,
130+
"log_errors": true
131+
},
132+
"naming_conventions": {
133+
"variables": "snake_case",
134+
"functions": "snake_case",
135+
"classes": "PascalCase",
136+
"interfaces": "PascalCase",
137+
"files": "snake_case"
138+
}
139+
},
140+
"project_configuration": {
141+
"language": "Python",
142+
"version": "3.13.2",
143+
"dependencies": {
144+
"management_tool": "Poetry",
145+
"libraries": [
146+
"discord.py",
147+
"pyright",
148+
"prisma",
149+
"ruff",
150+
"loguru",
151+
"httpx",
152+
"pre-commit",
153+
"sentry-sdk",
154+
"python-dotenv",
155+
"pytz",
156+
"pillow",
157+
"rich",
158+
"aiofiles",
159+
"reactionmenu"
160+
]
161+
},
162+
"development": {
163+
"environment": "Docker",
164+
"deployment_tool": "Docker Compose"
165+
},
166+
"error_handling": {
167+
"logging_tool": "Loguru",
168+
"exception_management": "Sentry and handlers/error.py"
169+
}
170+
}
171+
}

.dockerignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,18 @@
44
.github/
55
.venv/
66
.vscode/
7+
.cache/
8+
__pycache__/
9+
*.pyc
10+
assets/
11+
.archive/
12+
docs/
13+
docs-build/
14+
site/
15+
.markdownlint.yaml
16+
.mise.toml
17+
.python-version
18+
.pre-commit-config.yaml
19+
.gitignore
20+
.cursorrules
21+
.editorconfig

.editorconfig

Lines changed: 0 additions & 19 deletions
This file was deleted.

.env.example

Lines changed: 57 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,69 @@
1-
#
2-
# Required
3-
#
1+
# Tux Environment Configuration (.env.example)
2+
# -------------------------------------------
3+
# Copy this file to .env and fill in the values.
4+
# Do NOT commit your actual .env file to version control.
45

5-
# If in production mode:
6+
# Core Requirements
7+
# -----------------
8+
# These variables are fundamental and required depending on the mode.
69

7-
# DEV=False
10+
# Database URLs (Required: one depending on mode)
11+
# The application uses DEV_DATABASE_URL when run with '--dev' flag,
12+
# and PROD_DATABASE_URL otherwise (production mode).
13+
DEV_DATABASE_URL=""
814
PROD_DATABASE_URL=""
9-
PROD_TOKEN=""
1015

11-
# If in development mode:
16+
# Bot Tokens (Required: one depending on mode)
17+
# The application uses DEV_BOT_TOKEN when run with '--dev' flag,
18+
# and PROD_BOT_TOKEN otherwise (production mode).
19+
DEV_BOT_TOKEN=""
20+
PROD_BOT_TOKEN=""
1221

13-
# DEV=True
14-
DEV_DATABASE_URL=""
15-
DEV_TOKEN=""
22+
# Development Specific Settings
23+
# ---------------------------
24+
# These settings primarily affect development mode ('--dev').
25+
26+
# Cogs to ignore during development (Optional, comma-separated)
27+
# Example: DEV_COG_IGNORE_LIST="somecog,anothercog"
28+
DEV_COG_IGNORE_LIST="rolecount,mail,git" # Default ignores ATL-specific cogs
29+
30+
# Production Specific Settings
31+
# --------------------------
32+
# These settings primarily affect production mode (no '--dev' flag).
33+
34+
# Cogs to ignore in production (Optional, comma-separated)
35+
# Example: PROD_COG_IGNORE_LIST="debugcog"
36+
PROD_COG_IGNORE_LIST="rolecount,mail,git" # Default ignores ATL-specific cogs
1637

17-
#
18-
# Optional
19-
#
38+
# Optional Feature Configuration
39+
# ----------------------------
40+
# Fill these variables to enable optional integrations.
2041

21-
SENTRY_URL=""
42+
# Sentry (Error Tracking)
43+
# SENTRY_URL=""
2244

23-
PROD_COG_IGNORE_LIST="rolecount,mail" # These are ATL specific cogs that are not needed in Tux unless you are ATL
24-
DEV_COG_IGNORE_LIST=
45+
# InfluxDB (Metrics/Logging)
46+
# ------------------
2547

26-
GITHUB_APP_ID=
27-
GITHUB_CLIENT_ID=""
28-
GITHUB_CLIENT_SECRET=""
29-
GITHUB_PUBLIC_KEY=""
30-
GITHUB_INSTALLATION_ID=
48+
# INFLUXDB_TOKEN=""
49+
# INFLUXDB_URL=""
50+
# INFLUXDB_ORG=""
3151

32-
GITHUB_PRIVATE_KEY_BASE64=""
52+
# GitHub Integration
53+
# ------------------
54+
# These variables are used for the ATL GitHub integration that is is used for creating issues quickly.
55+
# You can safely ignore these until we have a proper way to guide using them multi guild/self hosted wise.
3356

34-
GITHUB_REPO_URL=
35-
GITHUB_REPO_OWNER=
36-
GITHUB_REPO=
57+
# GITHUB_APP_ID=
58+
# GITHUB_CLIENT_ID=""
59+
# GITHUB_CLIENT_SECRET=""
60+
# GITHUB_PUBLIC_KEY=""
61+
# GITHUB_INSTALLATION_ID=
62+
# GITHUB_PRIVATE_KEY_BASE64="" # Base64 encoded private key
63+
# GITHUB_REPO_URL=
64+
# GITHUB_REPO_OWNER=
65+
# GITHUB_REPO=
3766

38-
MAILCOW_API_KEY=
39-
MAILCOW_API_URL=
67+
# Mailcow Integration (Email related features)
68+
# MAILCOW_API_KEY=
69+
# MAILCOW_API_URL=

.github/renovate.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"timezone": "America/New_York",
4+
"schedule": ["* 0 * * 0"],
35
"extends": [
46
"config:recommended"
57
]

.github/workflows/docker-image.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
name: Create and Publish Docker Image CI
2-
1+
name: "GHCR - Build and Push Docker Image"
32

43
on:
54
push:
6-
branches: [ "main" ]
5+
branches: ["main"]
76
pull_request:
87

98
jobs:
10-
119
docker:
12-
1310
runs-on: ubuntu-latest
1411
permissions:
1512
contents: read
@@ -21,19 +18,22 @@ jobs:
2118
uses: docker/metadata-action@v5
2219
with:
2320
images: |
24-
ghcr.io/allthingslinux/tux
21+
ghcr.io/allthingslinux/tux
2522
tags: |
2623
type=raw,value=latest,enable={{is_default_branch}}
2724
type=ref,event=pr
25+
2826
- name: Set up Docker Buildx
2927
uses: docker/setup-buildx-action@v3
28+
3029
- name: Login to GHCR
3130
if: github.event_name != 'pull_request'
3231
uses: docker/login-action@v3
3332
with:
3433
registry: ghcr.io
3534
username: ${{ github.actor }}
3635
password: ${{ secrets.GITHUB_TOKEN }}
36+
3737
- name: Build and push
3838
uses: docker/build-push-action@v6
3939
with:

.github/workflows/linting.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
name: 'Linting'
1+
name: "Ruff - Linting and Formatting"
22

3-
on: [ push, pull_request ]
3+
on: [push, pull_request]
44

55
permissions:
66
contents: write
77
issues: write
88
pull-requests: write
99

1010
jobs:
11-
Linting:
11+
Ruff:
1212
runs-on: ubuntu-24.04
1313
steps:
14-
- name: 'Checkout Repository'
14+
- name: "Checkout Repository"
1515
uses: actions/checkout@v4
1616
with:
17-
token: ${{ secrets.ADMIN_PAT || github.token }}
17+
token: ${{ github.token }}
1818

1919
# Install Python
2020
- name: Setup Python
@@ -31,4 +31,4 @@ jobs:
3131
run: ruff format && ruff check . --fix
3232
- uses: stefanzweifel/git-auto-commit-action@v5
3333
with:
34-
commit_message: 'fix: Linting and formatting via Ruff'
34+
commit_message: "chore: Linting and formatting via Ruff"

0 commit comments

Comments
 (0)