Skip to content

Commit 4b23c91

Browse files
committed
Unified formatting for YAML, MD, JSON
Prettier configuration for the repository that can be invoked manually, or through pre-commit
1 parent 7c923ff commit 4b23c91

File tree

159 files changed

+14488
-7735
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+14488
-7735
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,33 @@ about: Create a report to help us improve
44
title: ''
55
labels: ''
66
assignees: ''
7-
87
---
98

10-
**Describe the bug**
11-
A clear and concise description of what the bug is.
9+
**Describe the bug** A clear and concise description of what the bug is.
10+
11+
**To Reproduce** Steps to reproduce the behavior:
1212

13-
**To Reproduce**
14-
Steps to reproduce the behavior:
1513
1. Go to '...'
1614
2. Click on '....'
1715
3. Scroll down to '....'
1816
4. See error
1917

20-
**Expected behavior**
21-
A clear and concise description of what you expected to happen.
18+
**Expected behavior** A clear and concise description of what you expected to
19+
happen.
2220

23-
**Screenshots**
24-
If applicable, add screenshots to help explain your problem.
21+
**Screenshots** If applicable, add screenshots to help explain your problem.
2522

2623
**Desktop (please complete the following information):**
27-
- OS: [e.g. iOS]
28-
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
24+
25+
- OS: [e.g. iOS]
26+
- Browser [e.g. chrome, safari]
27+
- Version [e.g. 22]
3028

3129
**Smartphone (please complete the following information):**
32-
- Device: [e.g. iPhone6]
33-
- OS: [e.g. iOS8.1]
34-
- Browser [e.g. stock browser, safari]
35-
- Version [e.g. 22]
3630

37-
**Additional context**
38-
Add any other context about the problem here.
31+
- Device: [e.g. iPhone6]
32+
- OS: [e.g. iOS8.1]
33+
- Browser [e.g. stock browser, safari]
34+
- Version [e.g. 22]
35+
36+
**Additional context** Add any other context about the problem here.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@ about: Suggest an idea for this project
44
title: ''
55
labels: ''
66
assignees: ''
7-
87
---
98

10-
**Is your feature request related to a problem? Please describe.**
11-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9+
**Is your feature request related to a problem? Please describe.** A clear and
10+
concise description of what the problem is. Ex. I'm always frustrated when [...]
1211

13-
**Describe the solution you'd like**
14-
A clear and concise description of what you want to happen.
12+
**Describe the solution you'd like** A clear and concise description of what you
13+
want to happen.
1514

16-
**Describe alternatives you've considered**
17-
A clear and concise description of any alternative solutions or features you've considered.
15+
**Describe alternatives you've considered** A clear and concise description of
16+
any alternative solutions or features you've considered.
1817

19-
**Additional context**
20-
Add any other context or screenshots about the feature request here.
18+
**Additional context** Add any other context or screenshots about the feature
19+
request here.

.gitignore

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,40 @@
1+
# Environment files
12
.env
3+
4+
# Build outputs
25
.aws-sam
36
build.toml
47
model.tar.gz
58
.checksum
69
.checksums/
710
.build_checksum
811
.lib_checksum
12+
dist/
13+
build/
14+
*.egg-info/
15+
16+
# IDE
917
.vscode/
18+
.idea/
19+
*.code-workspace
20+
21+
# OS
1022
.DS_Store
11-
dist/
23+
24+
# Temporary/Data
1225
.sav/
1326
.delete/
1427
.data/
15-
*.egg-info/
16-
build/
17-
__pycache__
18-
*.code-workspace
19-
.ruff_cache
2028
.kiro
2129
rvl_cdip_*
2230
notebooks/examples/data
23-
.idea/
2431
.dsr/
25-
*tmp-dev-assets*
32+
*tmp-dev-assets*
33+
34+
# Python
35+
__pycache__
36+
.ruff_cache
37+
38+
# Node.js (prettier/pre-commit)
39+
node_modules/
40+
package-lock.json

.gitlab-ci.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ stages:
2222
developer_tests:
2323
stage: developer_tests
2424
rules:
25-
- when: always # Run on all branches
26-
25+
- when: always # Run on all branches
26+
2727
before_script:
2828
- python --version
2929
- apt-get update -y
3030
- apt-get install make -y
31-
- pip install ruff
31+
- pip install ruff pre-commit
3232
# Install dependencies needed by publish.py for test imports
3333
- pip install typer rich boto3
3434
# Install test dependencies
@@ -37,7 +37,7 @@ developer_tests:
3737
script:
3838
- make lint-cicd
3939
- make test-cicd -C lib/idp_common_pkg
40-
40+
4141
artifacts:
4242
paths:
4343
- lib/idp_common_pkg/test-reports/coverage.xml
@@ -56,9 +56,9 @@ integration_tests:
5656
# AWS_CREDS_TARGET_ROLE: ${AWS_CREDS_TARGET_ROLE}
5757
# AWS_DEFAULT_REGION: ${AWS_DEFAULT_REGION}
5858
# IDP_ACCOUNT_ID: ${IDP_ACCOUNT_ID}
59-
60-
# Add rules to only run on develop branch
61-
# Add rules to only run on develop branch
59+
60+
# Add rules to only run on develop branch
61+
# Add rules to only run on develop branch
6262
rules:
6363
- if: $CI_COMMIT_BRANCH == "develop"
6464
when: always # always # When idp-accelerator CICD is reconfigured
@@ -70,13 +70,13 @@ integration_tests:
7070
when: manual
7171
- if: $CI_COMMIT_BRANCH =~ /^release\/.*/
7272
when: manual
73-
- when: manual # This will make it available on all other branches
73+
- when: manual # This will make it available on all other branches
7474

7575
before_script:
7676
- python --version
7777
- apt-get update -y
7878
- apt-get install zip unzip curl make -y
79-
79+
8080
# Install Poetry
8181
- curl -sSL https://install.python-poetry.org | python3 -
8282
- export PATH="/root/.local/bin:$PATH"
@@ -113,4 +113,3 @@ deployment_validation:
113113
script:
114114
# Check if service role has sufficient permissions for main stack deployment
115115
- python3 scripts/validate_service_role_permissions.py
116-

.pre-commit-config.yaml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Pre-commit hooks for code quality and formatting
2+
# See https://pre-commit.com for more information
3+
4+
repos:
5+
# Ruff - Python linter and formatter (replaces black, isort, flake8, etc.)
6+
- repo: https://github.com/astral-sh/ruff-pre-commit
7+
rev: v0.8.4
8+
hooks:
9+
# Run the linter
10+
- id: ruff
11+
args: [--fix]
12+
# Run the formatter
13+
- id: ruff-format
14+
15+
# Prettier - YAML, JSON, Markdown formatter
16+
- repo: https://github.com/pre-commit/mirrors-prettier
17+
rev: v3.1.0
18+
hooks:
19+
- id: prettier
20+
types_or: [yaml, json, markdown]
21+
exclude: |
22+
(?x)^(
23+
package-lock\.json|
24+
.*\.lock|
25+
\.aws-sam/.*|
26+
node_modules/.*|
27+
.*/testing/.*\.(json|yaml|yml)|
28+
.*/examples?/.*\.(json|yaml|yml)|
29+
.*[Ee]xample.*\.(json|yaml|yml)|
30+
.*[Tt]emplate.*\.(json|yaml|yml)
31+
)$
32+
33+
# General file checks
34+
- repo: https://github.com/pre-commit/pre-commit-hooks
35+
rev: v5.0.0
36+
hooks:
37+
- id: trailing-whitespace
38+
exclude: |
39+
(?x)^(
40+
.*\.md|
41+
\.aws-sam/.*
42+
)$
43+
- id: end-of-file-fixer
44+
exclude: \.aws-sam/.*
45+
- id: check-yaml
46+
args: [--unsafe] # Allow custom YAML tags (CloudFormation)
47+
exclude: |
48+
(?x)^(
49+
\.aws-sam/.*|
50+
templates/.*
51+
)$
52+
- id: check-json
53+
exclude: |
54+
(?x)^(
55+
\.vscode/.*|
56+
\.aws-sam/.*
57+
)$
58+
- id: check-added-large-files
59+
args: [--maxkb=5000]
60+
- id: check-merge-conflict
61+
- id: check-case-conflict
62+
- id: mixed-line-ending
63+
64+
# Python-specific checks
65+
- repo: https://github.com/pre-commit/pre-commit-hooks
66+
rev: v5.0.0
67+
hooks:
68+
- id: check-ast # Validate Python syntax
69+
- id: debug-statements # Check for debugger imports
70+
- id: name-tests-test # Ensure test files are named correctly
71+
args: [--pytest-test-first]
72+
73+
# Security checks
74+
- repo: https://github.com/Yelp/detect-secrets
75+
rev: v1.5.0
76+
hooks:
77+
- id: detect-secrets
78+
args: [--baseline, .secrets.baseline]
79+
exclude: |
80+
(?x)^(
81+
.*\.lock|
82+
package-lock\.json|
83+
\.aws-sam/.*
84+
)$
85+
86+
# Global configuration
87+
default_language_version:
88+
python: python3
89+
90+
# Don't fail if hooks are missing
91+
fail_fast: false
92+
93+
# Minimum pre-commit version
94+
minimum_pre_commit_version: "3.0.0"

.prettierignore

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Dependencies
2+
node_modules/
3+
**/node_modules/
4+
5+
# Build outputs
6+
build/
7+
dist/
8+
.aws-sam/
9+
**/.aws-sam/
10+
11+
# Python
12+
__pycache__/
13+
*.pyc
14+
*.pyo
15+
.venv/
16+
venv/
17+
env/
18+
19+
# IDE
20+
.vscode/
21+
.idea/
22+
*.swp
23+
*.swo
24+
25+
# OS
26+
.DS_Store
27+
Thumbs.db
28+
29+
# Logs
30+
*.log
31+
32+
# Environment files
33+
.env
34+
.env.*
35+
!.env.example
36+
!.env.*.template
37+
38+
# Lock files
39+
package-lock.json
40+
yarn.lock
41+
pnpm-lock.yaml
42+
43+
# Git
44+
.git/
45+
46+
# Specific files that shouldn't be formatted
47+
VERSION
48+
LICENSE
49+
NOTICE
50+
51+
# Template/example files with placeholder tokens (using <> syntax)
52+
**/testing/**/*.json
53+
**/examples/**/*.json
54+
**/*Example*.json
55+
**/*Template*.json
56+
**/*example*.json
57+
**/*template*.json

.prettierrc.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"printWidth": 120,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"trailingComma": "all",
8+
"overrides": [
9+
{
10+
"files": ["*.yaml", "*.yml"],
11+
"options": {
12+
"printWidth": 120,
13+
"tabWidth": 2,
14+
"useTabs": false,
15+
"bracketSpacing": true,
16+
"singleQuote": false,
17+
"proseWrap": "preserve"
18+
}
19+
},
20+
{
21+
"files": ["template.yaml", "**/template.yaml", "**/*.template.yaml"],
22+
"options": {
23+
"printWidth": 120,
24+
"tabWidth": 2,
25+
"proseWrap": "preserve"
26+
}
27+
},
28+
{
29+
"files": ["*.js", "*.jsx", "*.ts", "*.tsx"],
30+
"options": {
31+
"printWidth": 120,
32+
"singleQuote": true,
33+
"trailingComma": "all"
34+
}
35+
},
36+
{
37+
"files": "*.json",
38+
"options": {
39+
"printWidth": 120,
40+
"tabWidth": 2
41+
}
42+
},
43+
{
44+
"files": "*.md",
45+
"options": {
46+
"printWidth": 80,
47+
"proseWrap": "always"
48+
}
49+
}
50+
]
51+
}

.secrets.baseline

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)