Skip to content
Open
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
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ charset = utf-8
[{*.py,*.js,*.vue,*.css,*.scss,*.html}]
indent_style = tab
indent_size = 4
tab_width = 4
max_line_length = 99

# JSON files - mostly doctype schema files
Expand Down
16 changes: 13 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
exclude: 'node_modules|.git'
exclude: '(^|/)(node_modules|\\.git)(/|$)'
default_stages: [pre-commit]
default_install_hook_types: [pre-commit, commit-msg]
fail_fast: false


repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
files: "one_lms.*"
exclude: ".*json$|.*txt$|.*csv|.*md|.*svg"
- id: no-commit-to-branch
args: ['--branch', 'staging', '--branch', 'test-production', '--branch', 'version-15']
- id: check-merge-conflict
- id: check-ast
- id: check-json
Expand All @@ -18,7 +21,7 @@ repos:
- id: debug-statements

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.1
rev: v0.14.10
hooks:
- id: ruff
name: "Run ruff import sorter"
Expand Down Expand Up @@ -63,6 +66,13 @@ repos:
one_lms/public/js/lib/.*
)$

- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.23.0
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ['conventional-changelog-conventionalcommits']

ci:
autoupdate_schedule: weekly
skip: []
Expand Down
35 changes: 35 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# AGENTS.md

This repository hosts the `one_lms` Frappe app.

## Commit Format

All commits must use conventional commit titles so `commitlint.config.js`, the
commit-msg pre-commit hook, and CI linting can validate them.

Use this format:

```text
<type>(<scope>): <subject>
```

Allowed types are:

- `build`
- `chore`
- `ci`
- `docs`
- `feat`
- `fix`
- `perf`
- `refactor`
- `revert`
- `style`
- `test`
- `deprecate`

For sprint work, use the work item ID as the scope:

```text
chore(WI-000795): align commitlint with Frappe
```
26 changes: 26 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
parserPreset: "conventional-changelog-conventionalcommits",
rules: {
"subject-empty": [2, "never"],
"type-case": [2, "always", "lower-case"],
"type-empty": [2, "never"],
"type-enum": [
2,
"always",
[
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
"test",
"deprecate",
],
],
},
};
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "one_lms",
"version": "15.0.0",
"private": true,
"devDependencies": {
"@commitlint/cli": "^19.0.0",
"@commitlint/config-conventional": "^19.0.0",
"conventional-changelog-conventionalcommits": "^7.0.0"
}
}