Skip to content

Commit 7aaeadf

Browse files
authored
chore: Sync Files - 2022/09/29 -- [bot] Synced file(s) with sammcj/template-repo (#130)
2 parents 22d7f52 + ac0e3ee commit 7aaeadf

File tree

5 files changed

+174
-30
lines changed

5 files changed

+174
-30
lines changed

.eslintrc.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = {
2121
sourceType: 'module',
2222
},
2323
plugins: ['import', 'prettier'],
24-
extends: ['prettier', 'eslint:recommended'],
24+
extends: ['plugin:prettier/recommended', 'eslint:recommended'],
2525
root: true,
2626
rules: {
2727
quotes: ['error', 'single', { avoidEscape: true }],
@@ -32,10 +32,7 @@ module.exports = {
3232
'object-curly-spacing': ['error', 'always'],
3333
'array-bracket-spacing': ['error', 'never'],
3434
'object-curly-newline': ['error', { multiline: true, consistent: true }],
35-
'object-property-newline': [
36-
'error',
37-
{ allowAllPropertiesOnSameLine: true },
38-
],
35+
'object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }],
3936
'keyword-spacing': ['error'],
4037
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
4138
'space-before-blocks': 'error',
@@ -46,15 +43,12 @@ module.exports = {
4643
'no-shadow': 'off',
4744
'no-use-before-define': 'off',
4845
'import/order': 'error',
46+
'prettier/prettier': 'error',
4947
'max-classes-per-file': ['error', 3],
5048
/** no console and debugger in CDK */
5149
'no-console': 'error',
5250
'no-debugger': 'error',
5351
'no-underscore-dangle': 'off',
54-
'lines-between-class-members': [
55-
'error',
56-
'always',
57-
{ exceptAfterSingleLine: true },
58-
],
52+
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
5953
},
6054
};

.github/config/labeller.yml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,7 @@ labels:
4444
baseBranch: "(^docs\/.*)/i"
4545
commits: "(^docs:.*|(IF-[0-9]+ -- docs.*))/i"
4646
files:
47-
any:
48-
[
49-
"**/docs/**",
50-
"**/doc/**",
51-
"**/*.md",
52-
"**/*.markdown",
53-
"**/*.rst",
54-
"**/*.txt",
55-
]
47+
any: ["**/docs/**", "**/doc/**", "**/*.md", "**/*.markdown", "**/*.rst", "**/*.txt"]
5648
count:
5749
gte: 1
5850
lte: 1000
@@ -140,15 +132,7 @@ labels:
140132
commits: "(^db:.*|.*sql|(IF-[0-9]+ -- db.*))/i"
141133
files:
142134
# regex glob to match a file with extension .sql in any directory recursively
143-
any:
144-
[
145-
"**/*.sql",
146-
"**/*.db",
147-
"**/db/**",
148-
"**/flyway.*",
149-
"**/migrations/**",
150-
"**/*.sqlite.*",
151-
]
135+
any: ["**/*.sql", "**/*.db", "**/db/**", "**/flyway.*", "**/migrations/**", "**/*.sqlite.*"]
152136
count:
153137
gte: 1
154138
lte: 1000
@@ -183,7 +167,7 @@ labels:
183167
matcher:
184168
title: ".*git.*/i"
185169
files:
186-
any: ["**/.git.*", "**/.husky/*"]
170+
any: ["**/.git.*", "**/.husky/*", "**/.pre-commit-config.*"]
187171
count:
188172
gte: 1
189173
lte: 1000

.github/workflows/lint-tf.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ jobs:
2222
# Note: Terraform is not needed for tflint
2323
- name: Install Terraform
2424
run: |
25-
brew install terraform
25+
curl -sSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
26+
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
27+
sudo apt-get update && sudo apt-get install terraform -y
2628
# Run init to get module code to be able to use `--module`
2729
- name: Terraform init
2830
run: |

.pre-commit-config.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.3.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
- id: check-case-conflict
12+
- id: check-json
13+
- id: check-merge-conflict
14+
- id: check-symlinks
15+
- id: check-toml
16+
- id: check-xml
17+
- id: detect-private-key
18+
- id: check-added-large-files
19+
20+
- repo: https://github.com/pre-commit/mirrors-eslint
21+
rev: v8.24.0
22+
hooks:
23+
- id: eslint
24+
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
25+
types: [file]
26+
additional_dependencies:
27+
28+
29+
30+
31+
32+
- repo: https://github.com/syntaqx/git-hooks
33+
rev: v0.0.17
34+
hooks:
35+
- id: shellcheck
36+
- id: shfmt

commitlint.config.js

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
module.exports = {
2+
parserPreset: 'conventional-changelog-conventionalcommits',
3+
rules: {
4+
'body-leading-blank': [1, 'always'],
5+
'body-max-line-length': [2, 'always', 100],
6+
'footer-leading-blank': [1, 'always'],
7+
'footer-max-line-length': [2, 'always', 100],
8+
'header-max-length': [2, 'always', 100],
9+
'subject-case': [2, 'never', ['sentence-case', 'start-case', 'pascal-case', 'upper-case']],
10+
'subject-empty': [2, 'never'],
11+
'subject-full-stop': [2, 'never', '.'],
12+
'type-case': [2, 'always', 'lower-case'],
13+
'type-empty': [2, 'never'],
14+
'type-enum': [
15+
2,
16+
'always',
17+
[
18+
'build',
19+
'chore',
20+
'ci',
21+
'docs',
22+
'feat',
23+
'fix',
24+
'perf',
25+
'refactor',
26+
'revert',
27+
'style',
28+
'test',
29+
],
30+
],
31+
},
32+
prompt: {
33+
questions: {
34+
type: {
35+
description: "Select the type of change that you're committing",
36+
enum: {
37+
feat: {
38+
description: 'A new feature',
39+
title: 'Features',
40+
emoji: '✨',
41+
},
42+
fix: {
43+
description: 'A bug fix',
44+
title: 'Bug Fixes',
45+
emoji: '🐛',
46+
},
47+
docs: {
48+
description: 'Documentation only changes',
49+
title: 'Documentation',
50+
emoji: '📚',
51+
},
52+
style: {
53+
description:
54+
'Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)',
55+
title: 'Styles',
56+
emoji: '💎',
57+
},
58+
refactor: {
59+
description: 'A code change that neither fixes a bug nor adds a feature',
60+
title: 'Code Refactoring',
61+
emoji: '📦',
62+
},
63+
perf: {
64+
description: 'A code change that improves performance',
65+
title: 'Performance Improvements',
66+
emoji: '🚀',
67+
},
68+
test: {
69+
description: 'Adding missing tests or correcting existing tests',
70+
title: 'Tests',
71+
emoji: '🚨',
72+
},
73+
build: {
74+
description:
75+
'Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)',
76+
title: 'Builds',
77+
emoji: '🛠',
78+
},
79+
ci: {
80+
description:
81+
'Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)',
82+
title: 'Continuous Integrations',
83+
emoji: '⚙️',
84+
},
85+
chore: {
86+
description: "Other changes that don't modify src or test files",
87+
title: 'Chores',
88+
emoji: '♻️',
89+
},
90+
revert: {
91+
description: 'Reverts a previous commit',
92+
title: 'Reverts',
93+
emoji: '🗑',
94+
},
95+
},
96+
},
97+
scope: {
98+
description: 'What is the scope of this change (e.g. component or file name)',
99+
},
100+
subject: {
101+
description: 'Write a short, imperative tense description of the change',
102+
},
103+
body: {
104+
description: 'Provide a longer description of the change',
105+
},
106+
isBreaking: {
107+
description: 'Are there any breaking changes?',
108+
},
109+
breakingBody: {
110+
description:
111+
'A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself',
112+
},
113+
breaking: {
114+
description: 'Describe the breaking changes',
115+
},
116+
isIssueAffected: {
117+
description: 'Does this change affect any open issues?',
118+
},
119+
issuesBody: {
120+
description:
121+
'If issues are closed, the commit requires a body. Please enter a longer description of the commit itself',
122+
},
123+
issues: {
124+
description: 'Add issue references (e.g. "fix #123", "re #123".)',
125+
},
126+
},
127+
},
128+
};

0 commit comments

Comments
 (0)