From 87a0134c9e8fc455c313dd32e10296f8713f6d82 Mon Sep 17 00:00:00 2001 From: Kenneth Belitzky Date: Sun, 8 Jun 2025 06:09:45 +0000 Subject: [PATCH] Add Prettier and EditorConfig setup, enhance Copilot instructions, and implement pre-commit workflow --- .devcontainer/devcontainer.json | 6 +++++- .editorconfig | 8 +++----- .github/copilot-instructions.md | 7 ++++++- .../workflows/{pre-commit.yaml => z-pre-commit.yaml} | 4 ++-- .prettierignore | 2 ++ .prettierrc | 12 ++++++++++++ .struct.yaml | 2 ++ .../contribs/github/instructions/generic.yaml | 5 +++++ 8 files changed, 37 insertions(+), 9 deletions(-) rename .github/workflows/{pre-commit.yaml => z-pre-commit.yaml} (77%) create mode 100644 .prettierignore create mode 100644 .prettierrc create mode 100644 struct_module/contribs/github/instructions/generic.yaml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ec25b66..4d378dc 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -21,7 +21,11 @@ "davidanson.vscode-markdownlint", "foxundermoon.shell-format", "gruntfuggly.todo-tree" - ] + ], + "settings": { + "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode" + } } }, "mounts": [ diff --git a/.editorconfig b/.editorconfig index 793ef82..e5f71d3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,10 +1,8 @@ -# Editor configuration root = true - [*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true indent_style = space indent_size = 2 -end_of_line = lf -charset = utf-8 trim_trailing_whitespace = true -insert_final_newline = true diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 216db4e..3121815 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -1,7 +1,12 @@ # Copilot Instructions +## General Guidelines + +- Use 2 spaces for indentation. +- Write clear and concise comments to explain complex logic. + ## Pull Request Template -- Use the provided pull request template to ensure all necessary information is included. +- Use the provided pull request template located at .github/PULL_REQUEST_TEMPLATE.md to ensure all necessary information is included. - Fill in the sections with relevant details about the changes made, including a description of the issue being addressed and any additional context. - Use the checklist to confirm that you have followed the contributing guidelines and completed all necessary steps. diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/z-pre-commit.yaml similarity index 77% rename from .github/workflows/pre-commit.yaml rename to .github/workflows/z-pre-commit.yaml index ce0fc86..bcc9e01 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/z-pre-commit.yaml @@ -1,4 +1,4 @@ -name: pre-commit +name: z-pre-commit on: pull_request: @@ -11,5 +11,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4.2.2 - - uses: actions/setup-python@v5.5.0 + - uses: actions/setup-python@v5.6.0 - uses: pre-commit/action@v3.0.1 diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..b947077 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +node_modules/ +dist/ diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..6ad59f0 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,12 @@ +{ + "semi": true, + "trailingComma": "es5", + "singleQuote": true, + "endOfLine": "lf", + "tabWidth": 2, + "arrowParens": "always", + "printWidth": 80, + "bracketSpacing": true, + "quoteProps": "as-needed", + "proseWrap": "preserve" +} diff --git a/.struct.yaml b/.struct.yaml index 66d253e..9501e41 100644 --- a/.struct.yaml +++ b/.struct.yaml @@ -4,3 +4,5 @@ folders: - github/prompts/struct - github/workflows/pre-commit - github/workflows/release-drafter + - configs/prettier + - configs/editor-config diff --git a/struct_module/contribs/github/instructions/generic.yaml b/struct_module/contribs/github/instructions/generic.yaml new file mode 100644 index 0000000..169cc3b --- /dev/null +++ b/struct_module/contribs/github/instructions/generic.yaml @@ -0,0 +1,5 @@ +files: + - .github/instructions/generic.instruction.md: + skip_if_exists: true + content: | + Your instructions here