Skip to content

Commit 104c4fa

Browse files
Merge pull request #4 from CarterPerez-dev/chore/prettier-and-workflows
move workflow files - add prettier formatting and format
2 parents 2331bfa + a53ac28 commit 104c4fa

Some content is hidden

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

55 files changed

+648
-377
lines changed

PROJECTS/api-security-scanner/.github/workflows/eslint-check.yml renamed to .github/workflows/eslint-check.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ on:
44
pull_request:
55
branches: [ '*' ]
66
paths:
7-
- 'frontend/**/*.ts'
8-
- 'frontend/**/*.tsx'
9-
- 'frontend/eslint.config.js'
10-
- 'frontend/tsconfig*.json'
11-
- 'frontend/package.json'
7+
- 'PROJECTS/api-security-scanner/frontend/**/*.ts'
8+
- 'PROJECTS/api-security-scanner/frontend/**/*.tsx'
9+
- 'PROJECTS/api-security-scanner/frontend/eslint.config.js'
10+
- 'PROJECTS/api-security-scanner/frontend/tsconfig*.json'
11+
- 'PROJECTS/api-security-scanner/frontend/package.json'
1212
- '.github/workflows/eslint-check.yml'
1313

1414
jobs:
@@ -22,7 +22,7 @@ jobs:
2222

2323
defaults:
2424
run:
25-
working-directory: frontend
25+
working-directory: PROJECTS/api-security-scanner/frontend
2626

2727
steps:
2828
- name: Checkout code
@@ -33,7 +33,7 @@ jobs:
3333
with:
3434
node-version: '20'
3535
cache: 'npm'
36-
cache-dependency-path: frontend/package-lock.json
36+
cache-dependency-path: PROJECTS/api-security-scanner/frontend/package-lock.json
3737

3838
- name: Install dependencies
3939
run: npm install
@@ -106,7 +106,7 @@ jobs:
106106
uses: peter-evans/create-or-update-comment@v4
107107
with:
108108
issue-number: ${{ github.event.pull_request.number }}
109-
body-path: frontend/eslint-report.md
109+
body-path: PROJECTS/api-security-scanner/frontend/eslint-report.md
110110
edit-mode: replace
111111

112112
- name: Exit with proper code

PROJECTS/api-security-scanner/.github/workflows/lint.yml renamed to .github/workflows/lint.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,37 @@ jobs:
1212
lint:
1313
name: Run Linters
1414
runs-on: ubuntu-latest
15-
15+
1616
permissions:
1717
pull-requests: write
1818
contents: read
19-
19+
2020
defaults:
2121
run:
22-
working-directory: backend
23-
22+
working-directory: PROJECTS/api-security-scanner/backend
23+
2424
steps:
2525
- name: Checkout code
2626
uses: actions/checkout@v4
27-
27+
2828
- name: Set up Python
2929
uses: actions/setup-python@v5
3030
with:
3131
python-version: '3.12'
32-
32+
3333
- name: Cache pip dependencies
3434
uses: actions/cache@v4
3535
with:
3636
path: ~/.cache/pip
37-
key: ${{ runner.os }}-pip-${{ hashFiles('backend/pyproject.toml') }}
37+
key: ${{ runner.os }}-pip-${{ hashFiles('PROJECTS/api-security-scanner/backend/pyproject.toml') }}
3838
restore-keys: |
3939
${{ runner.os }}-pip-
40-
40+
4141
- name: Install dependencies
4242
run: |
4343
python -m pip install --upgrade pip
4444
pip install -e ".[dev]"
45-
45+
4646
- name: Run pylint
4747
id: pylint
4848
run: |
@@ -56,7 +56,7 @@ jobs:
5656
fi
5757
cat pylint-output.txt
5858
continue-on-error: true
59-
59+
6060
- name: Run ruff
6161
id: ruff
6262
run: |
@@ -70,7 +70,7 @@ jobs:
7070
fi
7171
cat ruff-output.txt
7272
continue-on-error: true
73-
73+
7474
- name: Run mypy
7575
id: mypy
7676
run: |
@@ -84,15 +84,15 @@ jobs:
8484
fi
8585
cat mypy-output.txt
8686
continue-on-error: true
87-
87+
8888
- name: Create Lint Summary
8989
id: create_summary
9090
if: github.event_name == 'pull_request'
9191
run: |
9292
{
9393
echo '## 🔍 Lint & Type Check Results'
9494
echo ''
95-
95+
9696
# Pylint Status
9797
if [[ "${{ env.PYLINT_PASSED }}" == "true" ]]; then
9898
echo '### ✅ Pylint: **Passed**'
@@ -107,7 +107,7 @@ jobs:
107107
echo '</details>'
108108
fi
109109
echo ''
110-
110+
111111
# Ruff Status
112112
if [[ "${{ env.RUFF_PASSED }}" == "true" ]]; then
113113
echo '### ✅ Ruff: **Passed**'
@@ -122,7 +122,7 @@ jobs:
122122
echo '</details>'
123123
fi
124124
echo ''
125-
125+
126126
# Mypy Status
127127
if [[ "${{ env.MYPY_PASSED }}" == "true" ]]; then
128128
echo '### ✅ Mypy: **Passed**'
@@ -137,7 +137,7 @@ jobs:
137137
echo '</details>'
138138
fi
139139
echo ''
140-
140+
141141
# Overall Summary
142142
if [[ "${{ env.PYLINT_PASSED }}" == "true" ]] && [[ "${{ env.RUFF_PASSED }}" == "true" ]] && [[ "${{ env.MYPY_PASSED }}" == "true" ]]; then
143143
echo '---'
@@ -149,11 +149,11 @@ jobs:
149149
echo ''
150150
echo '<!-- lint-check-comment-marker -->'
151151
} > ../lint-report.md
152-
152+
153153
- name: Post PR Comment
154154
if: github.event_name == 'pull_request'
155155
uses: peter-evans/create-or-update-comment@v4
156156
with:
157157
issue-number: ${{ github.event.pull_request.number }}
158-
body-path: lint-report.md
158+
body-path: PROJECTS/api-security-scanner/lint-report.md
159159
comment-marker: lint-check-comment-marker

PROJECTS/api-security-scanner/.github/workflows/typescript-check.yml renamed to .github/workflows/typescript-check.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ on:
44
pull_request:
55
branches: [ '*' ]
66
paths:
7-
- 'frontend/**/*.ts'
8-
- 'frontend/**/*.tsx'
9-
- 'frontend/tsconfig*.json'
10-
- 'frontend/package.json'
7+
- 'PROJECTS/api-security-scanner/frontend/**/*.ts'
8+
- 'PROJECTS/api-security-scanner/frontend/**/*.tsx'
9+
- 'PROJECTS/api-security-scanner/frontend/tsconfig*.json'
10+
- 'PROJECTS/api-security-scanner/frontend/package.json'
1111
- '.github/workflows/typescript-check.yml'
1212

1313
jobs:
@@ -21,7 +21,7 @@ jobs:
2121

2222
defaults:
2323
run:
24-
working-directory: frontend
24+
working-directory: PROJECTS/api-security-scanner/frontend
2525

2626
steps:
2727
- name: Checkout code
@@ -32,7 +32,7 @@ jobs:
3232
with:
3333
node-version: '20'
3434
cache: 'npm'
35-
cache-dependency-path: frontend/package-lock.json
35+
cache-dependency-path: PROJECTS/api-security-scanner/frontend/package-lock.json
3636

3737
- name: Install dependencies
3838
run: |
@@ -115,7 +115,7 @@ jobs:
115115
uses: peter-evans/create-or-update-comment@v4
116116
with:
117117
issue-number: ${{ github.event.pull_request.number }}
118-
body-path: frontend/typescript-report.md
118+
body-path: PROJECTS/api-security-scanner/frontend/typescript-report.md
119119
edit-mode: replace
120120

121121
- name: Exit with proper code

.pre-commit-config.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
repos:
2+
# Python Backend Checks
3+
- repo: https://github.com/astral-sh/ruff-pre-commit
4+
rev: v0.8.4
5+
hooks:
6+
- id: ruff
7+
name: ruff check (backend)
8+
args: [--fix, --exit-non-zero-on-fix]
9+
files: ^PROJECTS/api-security-scanner/backend/
10+
exclude: ^PROJECTS/api-security-scanner/backend/(\.venv|__pycache__|\.pytest_cache)/
11+
12+
- repo: local
13+
hooks:
14+
- id: yapf
15+
name: yapf format (backend)
16+
entry: bash -c 'cd PROJECTS/api-security-scanner/backend && yapf -i -r -vv models/ repositories/ schemas/ scanners/ core/ factory/'
17+
language: system
18+
types: [python]
19+
files: ^PROJECTS/api-security-scanner/backend/
20+
pass_filenames: false
21+
22+
- id: mypy
23+
name: mypy type check (backend)
24+
entry: bash -c 'cd PROJECTS/api-security-scanner/backend && mypy .'
25+
language: system
26+
types: [python]
27+
files: ^PROJECTS/api-security-scanner/backend/
28+
pass_filenames: false
29+
30+
- id: pylint
31+
name: pylint check (backend)
32+
entry: bash -c 'cd PROJECTS/api-security-scanner/backend && pylint **/*.py'
33+
language: system
34+
types: [python]
35+
files: ^PROJECTS/api-security-scanner/backend/
36+
pass_filenames: false
37+
38+
# Frontend TypeScript/ESLint Checks
39+
- id: eslint
40+
name: eslint check (frontend)
41+
entry: bash -c 'cd PROJECTS/api-security-scanner/frontend && npm run lint:eslint'
42+
language: system
43+
types_or: [ts, tsx, javascript, jsx]
44+
files: ^PROJECTS/api-security-scanner/frontend/src/
45+
pass_filenames: false
46+
47+
- id: typescript
48+
name: TypeScript type check (frontend)
49+
entry: bash -c 'cd PROJECTS/api-security-scanner/frontend && npm run lint:types'
50+
language: system
51+
types_or: [ts, tsx]
52+
files: ^PROJECTS/api-security-scanner/frontend/src/
53+
pass_filenames: false
54+
55+
# General File Checks
56+
- repo: https://github.com/pre-commit/pre-commit-hooks
57+
rev: v5.0.0
58+
hooks:
59+
- id: trailing-whitespace
60+
- id: end-of-file-fixer
61+
- id: check-yaml
62+
- id: check-json
63+
- id: check-merge-conflict
64+
- id: check-added-large-files
65+
args: ['--maxkb=1000']

PROJECTS/api-security-scanner/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ⒸAngelaMos | 2025
2-
# Gitignore - This is where you list files/folders that
2+
# Gitignore - This is where you list files/folders that
33
# should not be publicly commited to the remote repository
44

55
# Python

PROJECTS/api-security-scanner/backend/Makefile

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,25 @@ help:
4141
@echo "\033[1;4;91mSyntax Checking (Ruff):\033[0m"
4242
@echo " \033[92mmake \033[36mqa\033[0m \033[94m- Check all code for syntax issues\033[0m"
4343
@echo "\033[1;4;91mSyntax Fixing (Ruff):\033[0m"
44-
@echo " \033[92mmake \033[36mqa\033[0m \033[94m- Fix all code of syntax issues\033[0m"
44+
@echo " \033[92mmake \033[36mqa\033[0m \033[94m- Fix all code of syntax issues\033[0m"
4545
@echo ""
4646
@echo "\033[1;4;94mType Checking (mypy):\033[0m"
4747
@echo " \033[92mmake \033[36mqa\033[0m \033[94m- Type check all code\033[0m"
4848
@echo "\033[1;4;94mFormat:\033[0m"
49-
@echo " \033[92mmake \033[36mqa\033[0m \033[94m- Format code\033[0m"
49+
@echo " \033[92mmake \033[36mqa\033[0m \033[94m- Format code\033[0m"
5050
@echo ""
5151
@echo "\033[1;4;92mUtilities:\033[0m"
5252
@echo " \033[92mmake \033[36mclean\033[0m \033[94m- Remove all cache files\033[0m"
5353
@echo " \033[92mmake \033[36mtree\033[0m \033[94m- Display the file tree\033[0m"
54-
@echo " \033[92mmake \033[36mTODO\033[0m \033[94m- Find All TODO \033[0m"
54+
@echo " \033[92mmake \033[36mTODO\033[0m \033[94m- Find All TODO \033[0m"
5555
@echo ""
5656
@echo "\033[1;93mCurrent default domain: \033[1;5;95m$(DOMAIN)\033[0m"
5757
@echo ""
5858
@echo "\033[1;4;93mAvailable domains:\033[0m"
5959
@echo " \033[91maccount\033[0m, \033[92mcommunity\033[0m, \033[93mcontent\033[0m, \033[94mfreemium\033[0m, \033[95mgames\033[0m,"
6060
@echo " \033[96mmarketing\033[0m, \033[91mprogression\033[0m, \033[92mshop\033[0m, \033[93mtesting\033[0m, \033[94mtools\033[0m"
6161
@echo ""
62-
@echo "\033[95m ------------------------------"
62+
@echo "\033[95m ------------------------------"
6363
@echo "\033[34m ⣿⣿⣿⡷⠊⡢⡹⣦⡑⢂⢕⢂⢕⢂⢕⢂⠕⠔⠌⠝⠛⠶⠶⢶⣦⣄⢂⢕⢂⢕"
6464
@echo "\033[34m ⣿⣿⠏⣠⣾⣦⡐⢌⢿⣷⣦⣅⡑⠕⠡⠐⢿⠿⣛⠟⠛⠛⠛⠛⠡⢷⡈⢂⢕⢂"
6565
@echo "\033[34m ⠟⣡⣾⣿⣿⣿⣿⣦⣑⠝⢿⣿⣿⣿⣿⣿⡵⢁⣤⣶⣶⣿⢿⢿⢿⡟⢻⣤⢑⢂"
@@ -70,7 +70,7 @@ help:
7070
@echo "\033[32m ⠣⡁⠹⡪⡪⡪⡪⣪⣾⣿⣿⣿⣿⠋⠐⢉⢍⢄⢌⠻⣿⣿⣿⣿⣿⣿⣿⣿⠏⠈"
7171
@echo "\033[32m ⡣⡘⢄⠙⣾⣾⣾⣿⣿⣿⣿⣿⣿⡀⢐⢕⢕⢕⢕⢕⡘⣿⣿⣿⣿⣿⣿⠏⠠⠈"
7272
@echo "\033[32m ⠌⢊⢂⢣⠹⣿⣿⣿⣿⣿⣿⣿⣿⣧⢐⢕⢕⢕⢕⢕⢅⣿⣿⣿⣿⡿⢋⢜⠠⠈"
73-
@echo "\033[95m ------------------------------"
73+
@echo "\033[95m ------------------------------"
7474
@echo "\033[0m"
7575

7676

@@ -104,20 +104,20 @@ check:
104104
@ruff check .
105105
$(call ASCII)
106106

107-
107+
108108
# ==================== Syntax Checking (Ruff) ====================
109109
fix:
110110
@echo "\033[1;3;4;96m======== ruff fix All Code ========\033[0m"
111111
@ruff check . --fix
112112
$(call ASCII)
113-
113+
114114

115115
# ======================= In Depth Linting (pylint)=======================
116116
pylint:
117117
@echo "\033[1;3;4;96m======== Linting All Code ========\033[0m"
118118
@pylint .
119119
$(call ASCII)
120-
120+
121121
# ======================= Type Checking (mypy) =======================
122122
mypy:
123123
@echo "\033[1;3;4;96m======== Type Checking All Code ========\033[0m"
@@ -146,9 +146,8 @@ tree:
146146
@echo "\033[1;3;4;96m======== Creating Tree ========\033[0m"
147147
@tree -I 'node_modules|.git|*.log|dist|build|*.cache|certgames.egg-info|context|.venv|*.env|qa_context'
148148
$(call ASCII)
149-
149+
150150
TODO:
151151
@echo "\033[1;3;4;96m======== Looking for TODO's ========\033[0m"
152152
@find . -name "*.py" -print0 | xargs -0 pylint --disable=all --enable=W0511 --msg-template='{path}:{line}:{column}: {msg_id}: {msg} ({symbol})' || true
153153
$(call ASCII)
154-

PROJECTS/api-security-scanner/backend/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
ⒸAngelaMos | CarterPerez-dev
2+
ⒸAngelaMos | CarterPerez-dev
33
ⒸCertGames.com | 2025
44
----
55
API Security Scanner
@@ -15,6 +15,6 @@
1515
⣿⣿⣿⣿⣿⣿⣿⣿⠄⣴⣿⣶⣄⠄⣴⣶⠄⢀⣾⣿⣿⣿⣿⣿⣿⠃⠄⠄
1616
⠈⠻⣿⣿⣿⣿⣿⣿⡄⢻⣿⣿⣿⠄⣿⣿⡀⣾⣿⣿⣿⣿⣛⠛⠁
1717
⠄⠄⠈⠛⢿⣿⣿⣿⠁⠞⢿⣿⣿⡄⢿⣿⡇⣸⣿⣿⠿⠛⠁⠄
18-
⠄⠄⠄⠄⠄⠉⠻⣿⣿⣾⣦⡙⠻⣷⣾⣿⠃⠿⠋⠁⠄
18+
⠄⠄⠄⠄⠄⠉⠻⣿⣿⣾⣦⡙⠻⣷⣾⣿⠃⠿⠋⠁⠄
1919
2020
"""

PROJECTS/api-security-scanner/backend/config.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ class Settings(BaseSettings):
1616
"""
1717

1818
model_config = SettingsConfigDict(
19-
env_file = "../.env",
20-
env_file_encoding = "utf-8",
21-
case_sensitive = True
19+
env_file="../.env", env_file_encoding="utf-8", case_sensitive=True
2220
)
2321

2422
# Application metadata
@@ -86,9 +84,7 @@ def cors_origins_list(self) -> list[str]:
8684
"""
8785
Convert comma separated CORS origins string to list
8886
"""
89-
return [
90-
origin.strip() for origin in self.CORS_ORIGINS.split(",")
91-
]
87+
return [origin.strip() for origin in self.CORS_ORIGINS.split(",")]
9288

9389

9490
@lru_cache

0 commit comments

Comments
 (0)