Skip to content

Commit e98f5bd

Browse files
committed
chore: Use our own ruls
1 parent da60324 commit e98f5bd

File tree

4 files changed

+60
-13
lines changed

4 files changed

+60
-13
lines changed

.clang-format

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
BasedOnStyle: LLVM
33
---
44
Language: Cpp
5-
AccessModifierOffset: -2
5+
AccessModifierOffset: -4
66
AlignAfterOpenBracket: Align
77
AlignArrayOfStructures: None
88
AlignConsecutiveAssignments: None
@@ -55,8 +55,6 @@ BreakTemplateDeclarations: Yes
5555
ColumnLimit: 80
5656
CommentPragmas: '^ IWYU pragma:'
5757
CompactNamespaces: false
58-
ConstructorInitializerIndentWidth: 2
59-
ContinuationIndentWidth: 2
6058
Cpp11BracedListStyle: true
6159
DerivePointerAlignment: false
6260
DisableFormat: false
@@ -84,7 +82,8 @@ IndentExternBlock: NoIndent
8482
IndentGotoLabels: false
8583
IndentPPDirectives: None
8684
IndentRequiresClause: true
87-
IndentWidth: 2
85+
ConstructorInitializerIndentWidth: 4
86+
ContinuationIndentWidth: 4
8887
IndentWrappedFunctionNames: false
8988
InsertBraces: true
9089
InsertNewlineAtEOF: true
@@ -109,7 +108,7 @@ MaxEmptyLinesToKeep: 1
109108
NamespaceIndentation: None
110109
NamespaceMacros: []
111110
OneLineFormatOffRegex: ''
112-
PPIndentWidth: 2
111+
PPIndentWidth: 4
113112
PackConstructorInitializers: Never
114113
PenaltyBreakAssignment: 2
115114
PenaltyBreakBeforeFirstCallParameter: 19
@@ -176,7 +175,8 @@ SpacesInSquareBrackets: false
176175
Standard: Latest
177176
StatementAttributeLikeMacros: []
178177
StatementMacros: []
179-
TabWidth: 2
178+
TabWidth: 4
179+
IndentWidth: 4
180180
TemplateNames: []
181181
TypeNames: []
182182
TypenameMacros: []

.commitlintrc.js

100644100755
Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,52 @@
11
module.exports = {
2-
extends : ["@commitlint/config-conventional"],
3-
rules : {
4-
"header-max-length" : [1, "always", 50],
5-
"body-max-line-length" : [1, "always", 72]
6-
}
7-
}
2+
extends: ["@commitlint/config-conventional"],
3+
plugins: [
4+
{
5+
rules: {
6+
// custom rule: enforce scope formats
7+
// - for `retry`: require a result code scope: WA,TLE,OLE,MLE,RE,PE,CE,CREDIT (e.g. retry(WA))
8+
// - for `solve` and `skip`: no special validation
9+
"scope-format": (parsed) => {
10+
const t = parsed.type;
11+
const s = parsed.scope || "";
12+
if (t === "retry") {
13+
const ok = /^(WA|TLE|OLE|MLE|RE|PE|CE|CREDIT)$/.test(s);
14+
return [
15+
ok,
16+
"For type 'retry' the scope must be one of WA,TLE,OLE,MLE,RE,PE,CE,CREDIT (e.g. retry(WA))",
17+
];
18+
}
19+
return [true];
20+
},
21+
},
22+
},
23+
],
24+
rules: {
25+
"header-max-length": [1, "always", 50],
26+
"body-max-line-length": [1, "always", 72],
27+
// allowed commit types (prefixes)
28+
"type-enum": [
29+
2,
30+
"always",
31+
[
32+
"refactor",
33+
"docs",
34+
"test",
35+
"revert",
36+
"perf",
37+
"build",
38+
"solve",
39+
"chore",
40+
"fix",
41+
"ci",
42+
"skip",
43+
"retry",
44+
"style",
45+
],
46+
],
47+
// activate custom scope-format plugin rule
48+
"scope-format": [2, "always"],
49+
// disable subject-case enforcement so both "Do it" and "do it" are accepted
50+
"subject-case": [0, "always"],
51+
},
52+
};

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ root = true
1010
charset = utf-8
1111
end_of_line = lf
1212
insert_final_newline = true
13-
indent_size = 2
13+
indent_size = 4
1414
indent_style = space
1515
trim_trailing_whitespace = true
1616

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
.venv/
22
.vs/
33
.vscode/
4+
.nvim/
45
build/
56
coverage/
67
node_modules/
78
CMakeSettings.json
89
CMakeUserPresets.json
10+
.env

0 commit comments

Comments
 (0)