From 0fdfa3354d71aba50270c4660638c17ac177f98a Mon Sep 17 00:00:00 2001 From: Klaas van Schelven Date: Mon, 28 Jul 2025 22:28:10 +0200 Subject: [PATCH] GitHub copilot instructions: WIP --- .github/copilot-instructions.md | 8 +++++--- .github/workflows/copilot-setup-steps.yml | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 94d05f7..7201dbc 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -4,10 +4,12 @@ abstract generality. Python 3.12 is the standard environment. ## Coding Guidance * Keep it clear and simple. -* Avoid overly clever or verbose code — this isn't Java. -* Use Django idioms: models, views, middleware, etc. -* Follow PEP8 and ensure `flake8` passes (CI ignores E127, E741, E501, E731). * Use descriptive names, short functions, minimal boilerplate. +* Avoid overly clever or verbose code -- this isn't Java. +* Avoid overcommenting: only comment to explain unusual or complex logic or + design decisions +* Follow PEP8 and ensure `flake8` passes (CI ignores E741, E731). width: 120 columns. +* Use Django idioms: models, views, middleware, etc. ## Tests diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 4d95dac..5976603 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -17,6 +17,9 @@ jobs: env: DJANGO_SETTINGS_MODULE: bugsink.settings.development SAMPLES_DIR: ${{ github.workspace }}/event-samples + DJANGO_SUPERUSER_USERNAME: admin + DJANGO_SUPERUSER_EMAIL: admin@example.com + DJANGO_SUPERUSER_PASSWORD: admin steps: - name: Check out code uses: actions/checkout@v4 @@ -36,9 +39,19 @@ jobs: # To ensure correctness for more complex scenarios (e.g. multiple DBs), # we rely on the actual CI pipeline. + - name: Run migrations + run: | + python manage.py migrate + # Ensures the SQLite database is initialized. + + - name: Create superuser + run: | + python manage.py createsuperuser --noinput || true + # Creates a default admin user so Copilot can log in if needed. + # `|| true` prevents failure if the user already exists. + - name: Fetch event-samples data uses: actions/checkout@v4 with: repository: bugsink/event-samples path: event-samples -