Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Commit 9dc6b00

Browse files
committed
docs: [#10] add mandatory linting requirement to copilot instructions
- Add pre-commit linting requirement to Git Actions section - Add Automated Linting section to Code Quality Standards - Document all lint.sh command options and usage - Enforce ./scripts/lint.sh must pass before any commit - Ensure consistent code quality across all file types
1 parent 3d5c1ee commit 9dc6b00

File tree

1 file changed

+44
-11
lines changed

1 file changed

+44
-11
lines changed

.github/copilot-instructions.md

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,18 @@ make test-syntax # Syntax validation only
118118

119119
### Main Commands
120120

121-
| Command | Purpose |
122-
| ------------------------- | --------------------------------- |
123-
| `make help` | Show all available commands |
121+
| Command | Purpose |
122+
| ------------------------- | ------------------------------------------- |
123+
| `make help` | Show all available commands |
124124
| `make install-deps` | Install OpenTofu, libvirt, KVM, virt-viewer |
125-
| `make test` | Run complete infrastructure tests |
126-
| `make apply` | Deploy VM with full configuration |
127-
| `make apply-minimal` | Deploy VM with minimal config |
128-
| `make ssh` | Connect to deployed VM |
129-
| `make console` | Access VM console (text-based) |
130-
| `make vm-console` | Access VM graphical console (GUI) |
131-
| `make destroy` | Remove deployed VM |
132-
| `make monitor-cloud-init` | Watch VM provisioning progress |
125+
| `make test` | Run complete infrastructure tests |
126+
| `make apply` | Deploy VM with full configuration |
127+
| `make apply-minimal` | Deploy VM with minimal config |
128+
| `make ssh` | Connect to deployed VM |
129+
| `make console` | Access VM console (text-based) |
130+
| `make vm-console` | Access VM graphical console (GUI) |
131+
| `make destroy` | Remove deployed VM |
132+
| `make monitor-cloud-init` | Watch VM provisioning progress |
133133

134134
## 📋 Conventions and Standards
135135

@@ -186,6 +186,19 @@ make test-syntax # Syntax validation only
186186
- **Links**: Prefer relative links for internal documentation
187187
- **Code blocks**: Always specify language for syntax highlighting
188188

189+
#### Automated Linting
190+
191+
The project includes a comprehensive linting script that validates all file types:
192+
193+
```bash
194+
./scripts/lint.sh # Run all linters
195+
./scripts/lint.sh --yaml # Run only yamllint
196+
./scripts/lint.sh --shell # Run only ShellCheck
197+
./scripts/lint.sh --markdown # Run only markdownlint
198+
```
199+
200+
**IMPORTANT**: Always run `./scripts/lint.sh` before committing to ensure code quality standards are met.
201+
189202
#### TOML Configuration Files
190203

191204
- **Formatting**: Use [Even Better TOML](https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml) extension for VS Code
@@ -306,22 +319,26 @@ When providing assistance:
306319
#### Preferred Working Methodology
307320

308321
**Work in Small Steps:**
322+
309323
- Break down complex tasks into small, manageable increments
310324
- Each step should be independently testable and reviewable
311325
- Prefer multiple small commits over large monolithic changes
312326

313327
**Parallel Changes When Possible:**
328+
314329
- Identify changes that can be made independently
315330
- Suggest parallel work streams for unrelated modifications
316331
- Separate concerns to enable concurrent development
317332

318333
**Separate Refactors from Features:**
334+
319335
- **Refactoring commits**: Focus solely on code structure, organization, or cleanup
320336
- **Feature commits**: Focus on adding new functionality or enabling features
321337
- Never mix refactoring with feature addition in the same commit
322338
- Always complete refactoring first, then add features in subsequent commits
323339

324340
**Complex Tasks and Bug Fixes:**
341+
325342
- For any task that requires multiple intermediary steps, always present a plan first
326343
- Break down the approach into numbered steps with clear objectives
327344
- Ask for confirmation before implementing the plan
@@ -339,13 +356,15 @@ When providing assistance:
339356
- **NEVER** create or delete branches without explicit instruction
340357

341358
**Allowed git actions without permission:**
359+
342360
- `git status` - Check working tree status
343361
- `git diff` - Show changes between commits/files
344362
- `git log` - View commit history
345363
- `git show` - Display commit information
346364
- `git branch` - List branches (read-only)
347365

348366
**Actions requiring explicit permission:**
367+
349368
- `git add` - Stage changes for commit
350369
- `git commit` - Create new commits
351370
- `git push` - Push changes to remote
@@ -360,6 +379,20 @@ When providing assistance:
360379

361380
**Commit Signing Requirement**: All commits MUST be signed with GPG. When performing git commits, always use the default git commit behavior (which will trigger GPG signing) rather than `--no-gpg-sign`.
362381

382+
**Pre-commit Linting Requirement**: ALWAYS run the linting script before committing any changes:
383+
384+
```bash
385+
./scripts/lint.sh
386+
```
387+
388+
This script validates:
389+
390+
- YAML files with yamllint
391+
- Shell scripts with ShellCheck
392+
- Markdown files with markdownlint
393+
394+
Only commit if all linting checks pass. If linting fails, fix the issues before committing.
395+
363396
**Best Practice**: Always ask "Would you like me to commit these changes?" before performing any git state-changing operations.
364397

365398
## 📖 Additional Resources

0 commit comments

Comments
 (0)