@principal-ai/quality-lens-cli 0.1.18 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +71 -6
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1001,6 +1001,10 @@ jobs:
|
|
|
1001
1001
|
with:
|
|
1002
1002
|
node-version: '20'
|
|
1003
1003
|
|
|
1004
|
+
- name: Install project dependencies
|
|
1005
|
+
run: npm ci
|
|
1006
|
+
continue-on-error: true
|
|
1007
|
+
|
|
1004
1008
|
- name: Install Quality Lens CLI
|
|
1005
1009
|
run: npm install -g @principal-ai/quality-lens-cli
|
|
1006
1010
|
|
|
@@ -1011,16 +1015,77 @@ jobs:
|
|
|
1011
1015
|
if: always()
|
|
1012
1016
|
run: |
|
|
1013
1017
|
if [ -f results.json ]; then
|
|
1014
|
-
echo "
|
|
1018
|
+
echo ""
|
|
1019
|
+
echo "\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550"
|
|
1020
|
+
echo " QUALITY LENS RESULTS"
|
|
1021
|
+
echo "\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550"
|
|
1015
1022
|
node -e "
|
|
1016
1023
|
const fs = require('fs');
|
|
1017
1024
|
const results = JSON.parse(fs.readFileSync('results.json', 'utf8'));
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
console.log('
|
|
1022
|
-
console.log('
|
|
1025
|
+
|
|
1026
|
+
// Show hexagon scores
|
|
1027
|
+
const hex = results.qualityMetrics?.hexagon || {};
|
|
1028
|
+
console.log('');
|
|
1029
|
+
console.log('Quality Hexagon Scores:');
|
|
1030
|
+
console.log('\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500');
|
|
1031
|
+
const dimensions = ['tests', 'linting', 'types', 'formatting', 'deadCode', 'documentation'];
|
|
1032
|
+
for (const dim of dimensions) {
|
|
1033
|
+
const score = hex[dim] ?? 0;
|
|
1034
|
+
const bar = '\u2588'.repeat(Math.floor(score / 10)) + '\u2591'.repeat(10 - Math.floor(score / 10));
|
|
1035
|
+
const status = score === 0 ? '\u26A0\uFE0F NEEDS SETUP' : score >= 80 ? '\u2705' : score >= 50 ? '\u26A1' : '\u26A0\uFE0F';
|
|
1036
|
+
console.log(\` \${dim.padEnd(14)} \${bar} \${score.toString().padStart(3)}% \${status}\`);
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
// Show lens details
|
|
1040
|
+
console.log('');
|
|
1041
|
+
console.log('Lens Execution Details:');
|
|
1042
|
+
console.log('\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500');
|
|
1043
|
+
for (const r of results.results) {
|
|
1044
|
+
const success = r.execution?.success;
|
|
1045
|
+
const hasIssues = (r.issues?.length || 0) > 0;
|
|
1046
|
+
const hasMetrics = r.metrics && Object.keys(r.metrics).length > 0;
|
|
1047
|
+
const exitCode = r.execution?.exitCode;
|
|
1048
|
+
|
|
1049
|
+
let status = '\u2705 OK';
|
|
1050
|
+
let note = '';
|
|
1051
|
+
|
|
1052
|
+
if (!success) {
|
|
1053
|
+
status = '\u274C FAILED';
|
|
1054
|
+
note = ' - Tool could not run';
|
|
1055
|
+
} else if (!hasMetrics && !hasIssues) {
|
|
1056
|
+
status = '\u26A0\uFE0F NO DATA';
|
|
1057
|
+
if (exitCode === 2) {
|
|
1058
|
+
note = ' - Config error (check eslint/tsconfig)';
|
|
1059
|
+
} else {
|
|
1060
|
+
note = ' - Could not parse output';
|
|
1061
|
+
}
|
|
1062
|
+
} else if (hasIssues) {
|
|
1063
|
+
status = \`\u{1F4CB} \${r.issues.length} issues\`;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
console.log(\` \${r.lens.id.padEnd(12)} \${status}\${note}\`);
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
// Show action items if needed
|
|
1070
|
+
const needsAttention = results.results.filter(r =>
|
|
1071
|
+
!r.execution?.success ||
|
|
1072
|
+
(!r.issues?.length && !r.metrics?.totalIssues && r.execution?.exitCode !== 0)
|
|
1073
|
+
);
|
|
1074
|
+
|
|
1075
|
+
if (needsAttention.length > 0) {
|
|
1076
|
+
console.log('');
|
|
1077
|
+
console.log('\u26A0\uFE0F ACTION REQUIRED:');
|
|
1078
|
+
console.log('\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500');
|
|
1079
|
+
console.log('Some lenses could not run properly. Common fixes:');
|
|
1080
|
+
console.log(' \u2022 ESLint: Ensure .eslintrc or eslint.config.js exists');
|
|
1081
|
+
console.log(' \u2022 Jest: Ensure jest.config.js and test files exist');
|
|
1082
|
+
console.log(' \u2022 TypeScript: Ensure tsconfig.json is valid');
|
|
1083
|
+
console.log(' \u2022 Run "npm ci" locally to verify dependencies');
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
console.log('');
|
|
1023
1087
|
"
|
|
1088
|
+
echo "\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550"
|
|
1024
1089
|
fi
|
|
1025
1090
|
|
|
1026
1091
|
- name: Upload results artifact
|