Skip to content

Commit 21de45a

Browse files
committed
fix: commitlint.yaml is ignored
1 parent 9afdb66 commit 21de45a

File tree

7 files changed

+14
-18
lines changed

7 files changed

+14
-18
lines changed

.husky/commit-msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
DEBUG=true dart bin/commitlint_cli.dart --edit "$1"
4+
DEBUG=true dart bin/commitlint_cli.dart --edit "$1" --config lib/commitlint.yaml

.pubignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
docs/
22
scripts/
3-
test/
4-
commitlint.yaml
3+
test/

commitlint.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

lib/commitlint.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,9 @@ rules:
1919
- refactor
2020
- revert
2121
- style
22-
- test
22+
- test
23+
scope-enum:
24+
- 2
25+
- always
26+
- - deps
27+
- release

test/__fixtures__/include-path.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include: ./rules.yaml
1+
include: ../../lib/commitlint.yaml
22

33
rules:
44
type-case:

test/load_test.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ void main() {
99
expect(rules.isEmpty, true);
1010
});
1111
test('only `rules` should work', () async {
12-
final rules = await load(file: 'test/__fixtures__/rules.yaml');
12+
final rules = await load(file: 'test/__fixtures__/only-rules.yaml');
1313
expect(rules.isEmpty, false);
1414
expect(rules.keys.length, equals(2));
1515
expect(rules['type-case'], isA<CaseRuleConfig>());
@@ -18,18 +18,18 @@ void main() {
1818
expect((rules['type-enum'] as EnumRuleConfig).allowed,
1919
equals(['feat', 'fix', 'docs', 'chore']));
2020
});
21-
test('include path should work', () async {
21+
test('include relative path should work', () async {
2222
final rules = await load(file: 'test/__fixtures__/include-path.yaml');
2323
expect(rules.isEmpty, false);
24-
expect(rules.keys.length, equals(2));
24+
expect(rules.keys.length, greaterThan(1));
2525
expect(rules['type-case'], isA<CaseRuleConfig>());
2626
expect(rules['type-enum'], isA<EnumRuleConfig>());
2727
expect((rules['type-case'] as CaseRuleConfig).type, Case.upper);
2828
});
29-
test('include package should work', () async {
29+
test('include package path should work', () async {
3030
final rules = await load(file: 'test/__fixtures__/include-package.yaml');
3131
expect(rules.isEmpty, false);
32-
expect(rules.keys.length, equals(3));
32+
expect(rules.keys.length, greaterThan(1));
3333
expect(rules['type-case'], isA<CaseRuleConfig>());
3434
expect(rules['type-enum'], isA<EnumRuleConfig>());
3535
expect((rules['type-case'] as CaseRuleConfig).type, Case.upper);

0 commit comments

Comments
 (0)