redocly-cli
redocly-cli copied to clipboard
feat: implement scorecard-classic command
What/Why/How?
- Added new command
scorecard-classic. - Implemented functionality to fetch scorecard and plugins from project url.
- Implemented functionality to pass project url in arguments.
- Implemented functionality to use API key to fetch data.
- Implemented functionality to be able to output the result in JSON and stylish formats.
- Implemented functionality to check if command run in CI and throw error if API key is missing.
- Added verbose logs.
- Added tests.
Reference
Related: https://github.com/Redocly/redocly/issues/8775
Testing
Ran tests.
Screenshots (optional)
Check yourself
- [ ] Code changed? - Tested with Redoc/Realm/Reunite (internal)
- [x] All new/updated code is covered by tests
- [ ] New package installed? - Tested in different environments (browser/node)
- [x] Documentation update considered
Security
- [x] The security impact of the change has been considered
- [x] Code follows company security practices and guidelines
🦋 Changeset detected
Latest commit: c182102074a8bbdba022a9c1a29bba2363332827
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 3 packages
| Name | Type |
|---|---|
| @redocly/cli | Patch |
| @redocly/openapi-core | Patch |
| @redocly/respect-core | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
| Command | Mean [s] | Min [s] | Max [s] | Relative |
|---|---|---|---|---|
redocly lint resources/rebilly.yaml |
1.437 ± 0.058 | 1.379 | 1.588 | 1.00 ± 0.05 |
redocly-next lint resources/rebilly.yaml |
1.435 ± 0.030 | 1.395 | 1.485 | 1.00 |
Coverage Report
| Status | Category | Percentage | Covered / Total |
|---|---|---|---|
| 🔵 | Lines | 78.59% (🎯 78%) | 6104 / 7766 |
| 🔵 | Statements | 78.08% (🎯 78%) | 6308 / 8078 |
| 🔵 | Functions | 82.11% (🎯 81%) | 1249 / 1521 |
| 🔵 | Branches | 70.57% (🎯 70%) | 4200 / 5951 |
File Coverage
| File | Stmts | Branches | Functions | Lines | Uncovered Lines |
|---|---|---|---|---|---|
| Changed Files | |||||
| packages/cli/src/commands/scorecard-classic/index.ts | 0% | 0% | 0% | 0% | 21-129 |
| packages/cli/src/commands/scorecard-classic/auth/login-handler.ts | 100% | 88.88% | 100% | 100% | |
| packages/cli/src/commands/scorecard-classic/formatters/json-formatter.ts | 96.77% | 86.66% | 100% | 96.55% | 36 |
| packages/cli/src/commands/scorecard-classic/formatters/stylish-formatter.ts | 100% | 88.46% | 100% | 100% | |
| packages/cli/src/commands/scorecard-classic/remote/fetch-scorecard.ts | 80.3% | 75.92% | 100% | 80.3% | 58-61, 71-74, 128-129, 161, 168-171 |
| packages/cli/src/commands/scorecard-classic/validation/plugin-evaluator.ts | 83.33% | 73.68% | 100% | 82.75% | 17, 59-62 |
| packages/cli/src/commands/scorecard-classic/validation/validate-scorecard.ts | 97.22% | 88.88% | 100% | 97.05% | 38-40 |