GLDS: Get metrics of className usage in props (#71072)

This commit is contained in:
Laura Fernández
2023-07-07 13:39:52 +02:00
committed by GitHub
parent a9368aab7a
commit b34f3a6142

View File

@@ -6,6 +6,7 @@ ACCESSIBILITY_ERRORS="$(grep -oP '\"errors\":(\d+),' pa11y-ci-results.json | gre
DIRECTIVES="$(grep -r -o directive public/app/ | wc -l)" DIRECTIVES="$(grep -r -o directive public/app/ | wc -l)"
CONTROLLERS="$(grep -r -oP 'class .*Ctrl' public/app/ | wc -l)" CONTROLLERS="$(grep -r -oP 'class .*Ctrl' public/app/ | wc -l)"
LEGACY_FORMS="$(grep -r -oP 'LegacyForms;' public/app | wc -l)" LEGACY_FORMS="$(grep -r -oP 'LegacyForms;' public/app | wc -l)"
CLASSNAME_PROP="$(grep -r -o -E --include="*.ts*" "\.*.className=\W.*\W.*" public/app | wc -l)"
EMOTION_IMPORTS="$(grep -r -o -E --include="*.ts*" --exclude="*.test*" "\{.*css.*\} from '@emotion/css'" public/app | wc -l)" EMOTION_IMPORTS="$(grep -r -o -E --include="*.ts*" --exclude="*.test*" "\{.*css.*\} from '@emotion/css'" public/app | wc -l)"
TS_FILES="$(find public/app -type f -name "*.ts*" -not -name "*.test*" | wc -l)" TS_FILES="$(find public/app -type f -name "*.ts*" -not -name "*.test*" | wc -l)"
@@ -29,6 +30,7 @@ echo -e "Low vulnerabilities: $LOW_VULNERABILITIES"
echo -e "Med vulnerabilities: $MED_VULNERABILITIES" echo -e "Med vulnerabilities: $MED_VULNERABILITIES"
echo -e "High vulnerabilities: $HIGH_VULNERABILITIES" echo -e "High vulnerabilities: $HIGH_VULNERABILITIES"
echo -e "Critical vulnerabilities: $CRITICAL_VULNERABILITIES" echo -e "Critical vulnerabilities: $CRITICAL_VULNERABILITIES"
echo -e "ClassName in props: $CLASSNAME_PROP"
echo -e "@emotion/css imports: $EMOTION_IMPORTS" echo -e "@emotion/css imports: $EMOTION_IMPORTS"
echo -e "Total TS files: $TS_FILES" echo -e "Total TS files: $TS_FILES"
@@ -48,6 +50,7 @@ echo "Metrics: {
\"grafana.ci-code.legacyForms\": \"${LEGACY_FORMS}\", \"grafana.ci-code.legacyForms\": \"${LEGACY_FORMS}\",
\"grafana.ci-code.bundleFolderSize\": \"${TOTAL_BUNDLE}\", \"grafana.ci-code.bundleFolderSize\": \"${TOTAL_BUNDLE}\",
\"grafana.ci-code.dependencies.outdated\": \"${OUTDATED_DEPENDENCIES}\", \"grafana.ci-code.dependencies.outdated\": \"${OUTDATED_DEPENDENCIES}\",
\"grafana.ci-code.props.className\": \"${CLASSNAME_PROP}\"
\"grafana.ci-code.imports.emotion\": \"${EMOTION_IMPORTS}\", \"grafana.ci-code.imports.emotion\": \"${EMOTION_IMPORTS}\",
\"grafana.ci-code.tsFiles\": \"${TS_FILES}\" \"grafana.ci-code.tsFiles\": \"${TS_FILES}\"
}" }"