ayush00git opened a new pull request, #3158:
URL: https://github.com/apache/fory/pull/3158
## Why?
The CI format check was failing due to two issues:
1. Permission denied error when attempting to install prettier globally in
the CI environment
2. Indentation inconsistencies in `typeInfo.ts` that violated ESLint rules
The indentation changes in `typeInfo.ts` were introduced in PR #3139 for
better code readability. These formatting improvements needed corresponding CI
script fixes to ensure the format checks pass without permission errors.
These failures were blocking the CI pipeline and needed to be resolved to
ensure code quality checks pass.
## What does this PR do?
This PR fixes the CI format script and corrects TypeScript indentation
issues to ensure all linting checks pass.
### Changes Made
#### 1. `ci/format.sh`
**Fixed prettier installation to use local installation instead of global:**
```diff
+ # Install prettier locally if not already installed
+ if [ ! -f "$ROOT/javascript/node_modules/.bin/prettier" ]; then
+ npm install --prefix "$ROOT/javascript" prettier
+ fi
+ # Fix markdown files
+ node ./javascript/node_modules/.bin/prettier --write "**/*.md"
```
**Why this change?**
- Global npm installation (`npm install -g`) requires elevated permissions
(sudo)
- CI environments typically don't have sudo access, causing `EACCES:
permission denied` errors
- Local installation using `--prefix` flag installs to project's
`node_modules` without requiring special permissions
- Added conditional check to avoid reinstalling if prettier is already
present
### Verification
**Format Check:**
```bash
python ./ci/run_ci.py format
```
Passes successfully (exit code 1 is expected when changes are made)
## Related issues
N/A - This is a maintenance fix for CI infrastructure
## Does this PR introduce any user-facing change?
- [ ] **Does this PR introduce any public API change?**
- **No**: No changes to public APIs
- [ ] **Does this PR introduce any binary protocol compatibility change?**
- **No**: No changes to serialization or protocol
This PR only fixes CI tooling and code formatting - no functional changes to
the library.
## Benchmark
N/A - This PR only fixes formatting and CI infrastructure without modifying
any runtime code paths.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]