Skip to content

Commit 296cee3

Browse files
authored
Update checklist, template package.json, design and business templates (#3)
* Update checklist, template package.json, design and business templates * Update pre-commit. Add check for pattern shell script. Update github actions to node20 * revert to ubuntu * Update actions versions * update version * version * update python v * pre-commit update * try py 3.10 * try py 3.12 * test * 310 * test * test * test * test * test
1 parent 89b11d3 commit 296cee3

File tree

11 files changed

+115
-19
lines changed

11 files changed

+115
-19
lines changed

.github/workflows/security.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
- uses: actions/checkout@v3
1010
# E.g., to check for my `~/Local/.secret` file
1111
- name: Custom check for secret files
12-
run: ./osConfig/shell/bin/check_for_pattern.sh . "*secret*"
12+
run: ./check_for_pattern.sh . "*secret*"
1313
- name: Install Whispers
1414
run: sudo pip install whispers
1515
# Use whispers to check repo for unecrypted secrets, passwords, etc.

.github/workflows/validate.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ jobs:
99
- uses: actions/checkout@v3
1010
- uses: actions/setup-python@v4
1111
with:
12-
python-version: 3.x
13-
- uses: pre-commit/[email protected]
14-
- uses: pre-commit-ci/[email protected]
15-
if: always()
12+
python-version: 3.9
13+
- uses: pre-commit/[email protected]
14+
- uses: pre-commit-ci/[email protected]

.pre-commit-config.yaml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.4.0
3+
rev: v5.0.0
44
hooks:
55
- id: check-yaml
66
- id: end-of-file-fixer
@@ -12,7 +12,7 @@ repos:
1212
- id: check-merge-conflict
1313
- id: check-shebang-scripts-are-executable
1414
exclude: "^(codeTemplates/|tempalte/|{% if code_templates %}codeTemplates{% endif %}/)"
15-
- id: check-symlinks
15+
# - id: check-symlinks # I needed to disable since I use symbolic links to files outside my repo which will cause the CI check to fail.
1616
- id: check-toml
1717
- id: check-xml
1818
- id: debug-statements
@@ -22,11 +22,11 @@ repos:
2222
- id: mixed-line-ending
2323
- id: no-commit-to-branch
2424
- repo: https://github.com/psf/black
25-
rev: 22.10.0
25+
rev: 24.10.0
2626
hooks:
2727
- id: black
2828
- repo: https://github.com/detailyang/pre-commit-shell
29-
rev: v1.0.6
29+
rev: 1.0.5
3030
hooks:
3131
- id: shell-lint
3232
args:
@@ -38,21 +38,26 @@ repos:
3838
--severity=error,
3939
]
4040
- repo: https://github.com/antonbabenko/pre-commit-terraform
41-
rev: v1.81.0
41+
rev: v1.96.1
4242
hooks:
4343
- id: terraform_fmt
4444
- id: terraform_docs
4545
- id: terraform_checkov
4646
- id: infracost_breakdown
4747
- repo: https://github.com/adrienverge/yamllint
48-
rev: v1.26.0
48+
rev: v1.35.1
4949
hooks:
5050
- id: yamllint
5151
language_version: python3.9
52-
- repo: https://github.com/ansible/ansible-lint
53-
rev: v6.17.2
54-
hooks:
55-
- id: ansible-lint
52+
# - repo: https://github.com/ansible/ansible-lint
53+
# rev: v24.9.2
54+
# hooks:
55+
# - id: ansible-lint
56+
# entry: python3 -m ansiblelint -v --force-color
57+
# language: python
58+
# # do not pass files to ansible-lint, see:
59+
# # https://github.com/ansible/ansible-lint/issues/611
60+
# pass_filenames: false
5661
ci:
5762
autofix_commit_msg: |
5863
[pre-commit.ci] auto fixes from pre-commit.com hooks

Taskfile.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@ tasks:
1414
validate:
1515
cmds:
1616
- pre-commit run --all-files
17-
- task: snyk
1817
# - shellcheck osConfig/mac/updateMac.sh
1918
# - shellcheck osConfig/mac/setupMac.sh
2019
# - shellcheck osConfig/mac/configureMacSettings.sh
2120
silent: true
21+
pre-commit:
22+
cmds:
23+
- pre-commit run --all-files
24+
silent: true
2225
security:
2326
cmds:
24-
- utils/check_for_pattern.sh "secret" #TODO: Add this script
27+
- ./check_for_pattern.sh . "*secret*"
2528
- whispers --config test/whisperConfig.yml --severity BLOCKER,CRITICAL .
2629
- task: snyk
2730
silent: true

check_for_pattern.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
#==============================================================================
4+
# check_for_pattern
5+
#==============================================================================
6+
# Check specified directory recursively for given pattern.
7+
# You can use regex patterns like "*pattern*"
8+
# Returns exit 1 if anything was found.
9+
# Author: Evan Harmon
10+
11+
# -iname makes find case-insensitive
12+
check() {
13+
echo "Searching in: $1"
14+
if [[ $(find "$1" -iname $2) ]]; then
15+
echo -e "\033[0;31m $2 found! \033[0m"
16+
exit 1
17+
else
18+
echo -e "\033[1;32m $2 was not found. \033[0m"
19+
exit 0
20+
fi
21+
}
22+
23+
# Parse CLI input
24+
if [ $# -eq 0 ]; then
25+
echo "usage: check_for 'location' 'search text'"
26+
exit 0
27+
elif [[ $2 == "help" || $2 == "--help" || $2 == "-h" ]]; then
28+
echo "usage: check_for 'location' 'search text'"
29+
exit 0
30+
else
31+
check "$1" "$2"
32+
fi

template/Taskfile.yml.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ tasks:
2121
silent: true
2222
security:
2323
cmds:
24-
- utils/check_for_pattern.sh "secret" #TODO: Add this script
24+
- ./check_for_pattern.sh "secret"
2525
- whispers --config test/whisperConfig.yml --severity BLOCKER,CRITICAL .
2626
- task: snyk
2727
silent: true

template/check_for_pattern.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
#==============================================================================
4+
# check_for_pattern
5+
#==============================================================================
6+
# Check specified directory recursively for given pattern.
7+
# You can use regex patterns like "*pattern*"
8+
# Returns exit 1 if anything was found.
9+
# Author: Evan Harmon
10+
11+
# -iname makes find case-insensitive
12+
check() {
13+
echo "Searching in: $1"
14+
if [[ $(find "$1" -iname $2) ]]; then
15+
echo -e "\033[0;31m $2 found! \033[0m"
16+
exit 1
17+
else
18+
echo -e "\033[1;32m $2 was not found. \033[0m"
19+
exit 0
20+
fi
21+
}
22+
23+
# Parse CLI input
24+
if [ $# -eq 0 ]; then
25+
echo "usage: check_for 'location' 'search text'"
26+
exit 0
27+
elif [[ $2 == "help" || $2 == "--help" || $2 == "-h" ]]; then
28+
echo "usage: check_for 'location' 'search text'"
29+
exit 0
30+
else
31+
check "$1" "$2"
32+
fi

template/docs/CHECKLIST.md.jinja

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@
2525
- Setup pre-commit
2626
- CI/CD
2727
- Add branch protection to main branch (prevent direct pushes to main)
28+
- As of 2024 - GitHub doesn't let you setup branch protection on a private repo without being on a paid plan.
2829
- [ ] Testing Setup

template/package.json.jinja

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,18 @@
33
"version": "0.0.1",
44
"description": "{{ project_description }}",
55
"scripts": {
6-
"start": "todo"
6+
"start": "TODO: define npm command",
7+
"dev": "TODO: define npm command",
8+
"build": "TODO: define npm command",
9+
"preview": "TODO: define npm command",
10+
"deploy:staging": "TODO: define npm command",
11+
"deploy:prod": "TODO: define npm command",
12+
"check": "TODO: define npm command",
13+
"check:eslint": "eslint .",
14+
"check:prettier": "prettier --check .",
15+
"fix": "npm run fix:eslint && npm run fix:prettier",
16+
"fix:eslint": "eslint --fix .",
17+
"fix:prettier": "prettier -w ."
718
},
819
"devDependencies": {
920
"eslint": "^8.0.0",

template/{% if design %}design{% endif %}/diagrams/wireframeTemplate.f0

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)