Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 35 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -69,7 +72,30 @@ jobs:
run: npm ci --legacy-peer-deps

- name: Check formatting (Prettier)
id: prettier-check
run: npm run format:check
continue-on-error: true

- name: Auto-fix formatting issues
if: steps.prettier-check.outcome == 'failure'
run: |
echo "Formatting inconsistencies detected. Executing auto-fixer..."
npm run format:write || npx prettier --write "src/**/*.{ts,tsx,js,json,md}"

- name: Commit and Push formatting fixes
if: steps.prettier-check.outcome == 'failure'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'chore: automated code formatting fixes via CI pipeline'
commit_user_name: 'github-actions[bot]'
commit_user_email: 'github-actions[bot]@users.noreply.github.com'

- name: Enforce strict layout check
if: steps.prettier-check.outcome == 'failure'
run: |
echo "❌ Code styles were inconsistent. Automated modifications have been pushed to your branch."
echo "Please pull latest changes locally or wait for the subsequent workflow run execution pass."
exit 1

- name: Run ESLint
run: npm run lint
Expand Down Expand Up @@ -265,9 +291,9 @@ jobs:
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/cargo/registry/index/
~/cargo/registry/cache/
~/cargo/git/db/
contracts/target/
key: ${{ runner.os }}-cargo-${{ env.RUST_VERSION }}-${{ hashFiles('contracts/Cargo.lock') }}
restore-keys: |
Expand All @@ -293,9 +319,9 @@ jobs:
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/cargo/registry/index/
~/cargo/registry/cache/
~/cargo/git/db/
contracts/target/
key: ${{ runner.os }}-cargo-${{ env.RUST_VERSION }}-${{ hashFiles('contracts/Cargo.lock') }}
restore-keys: |
Expand All @@ -321,9 +347,9 @@ jobs:
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/cargo/registry/index/
~/cargo/registry/cache/
~/cargo/git/db/
contracts/target/
key: ${{ runner.os }}-cargo-${{ env.RUST_VERSION }}-${{ hashFiles('contracts/Cargo.lock') }}
restore-keys: |
Expand Down
29 changes: 29 additions & 0 deletions FORMATTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# SubTrackr Code Style & Formatting Guidelines

To maintain visual clarity, code style consistency, and minimize Git diff noise, this project automatically enforces strict code formatting.

## Style Rules

- **Engine**: Prettier & ESLint
- **Language Targets**: TypeScript (\.ts\, \.tsx\), JavaScript (\.js\), JSON (\.json\), Markdown (\.md\)
- **Formatting Constraints**: Configured automatically via \.prettierrc\ and \.eslintrc.json\.

## Local Development Workflows

Before submitting a Pull Request, run the local styling script blocks to verify adherence:

\\\ash

# Check if any files contain formatting errors

npm run format:check

# Manually write styling fixes across all directories

npm run format:write
\\\

## Continuous Integration (CI) Actions

- Every Pull Request triggers an automated style validation step.
- If formatting violations are detected, the CI runner will automatically attempt to run the formatter, commit the stylistic corrections directly back to your branch, and exit safely with clean error feedback logs.
149 changes: 148 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@
"react-native-screens": "~4.24.0",
"react-native-svg": "15.15.4",
"zod": "^3.23.8",
"zustand": "^4.5.2"
"zustand": "^4.5.2",
"react-dom": "19.0.0",
"react-native-web": "^0.20.0",
"@expo/metro-runtime": "~5.0.5"
},
"devDependencies": {
"@babel/core": "^7.29.0",
Expand Down
Loading