Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,17 @@ src/

### Commits

We follow conventional commits:
We follow [Conventional Commits](https://www.conventionalcommits.org/) to automate our release process. We use `husky` and `commitlint` to enforce this standard locally.

- `feat:` New features
- `fix:` Bug fixes
- `docs:` Documentation changes
- `test:` Test additions/changes
- `refactor:` Code refactoring
- `chore:` Maintenance tasks
Release Please assumes you are using Conventional Commit messages.

Example: `feat: add auto-detection of PHPStan config files`
The most important prefixes you should have in mind are:

- `fix`: which represents bug fixes, and correlates to a SemVer patch.
- `feat`: which represents a new feature, and correlates to a SemVer minor.
- `feat!`: or `fix!:`, `refactor!:`, etc., which represent a breaking change (indicated by the `!`) and will result in a SemVer major.

For a full list of types and rules, please visit [conventionalcommits.org](https://www.conventionalcommits.org/).

## Pull Request Process

Expand Down
8 changes: 8 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ This project is a VS Code extension that integrates PHPStan (Static Analysis) ru
- Use Status Bar items effectively to show tool status (Ready, Error, etc.).
- Provide "Quick Fixes" or buttons in error messages for common actions (like "Start DDEV").

5. **Commit Messages**:
- STRICTLY follow [Conventional Commits](https://www.conventionalcommits.org/) format: `type(scope): description`.
- Release Please assumes you are using Conventional Commit messages.
- Most important prefixes:
- `fix`: bug fixes (SemVer patch).
- `feat`: new features (SemVer minor).
- `feat!`, `fix!`, `refactor!`: breaking changes (SemVer major).

## Common Tasks

- **Adding a new setting**:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Commit Lint

on: [push, pull_request]

jobs:
commitlint:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-node@v5
with:
node-version: latest
- name: Install dependencies
run: npm ci
- name: Validate current commit (last commit)
if: github.event_name == 'push'
run: npx commitlint --from HEAD~1 --to HEAD --verbose
- name: Validate PR commits
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
2 changes: 2 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
npx --no -- commitlint --edit $1
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
npm run lint
2 changes: 2 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
npm test
8 changes: 8 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'body-max-line-length': [2, 'always', 300],
'footer-max-line-length': [2, 'always', 300],
},
};

Loading
Loading