Replace deprecated polylint

polylint was depreacted and replecaed by polymer linter from the
polymer-cli package.

Change-Id: I251ff7a59484c54b2215dd84a6a09b8ed825b01e
This commit is contained in:
Dmitrii Filippov 2019-11-12 18:08:00 +01:00
parent 585f6e2274
commit f0355091db
3 changed files with 32 additions and 7 deletions

View File

@ -8,7 +8,7 @@
"eslint-config-google": "^0.13.0",
"eslint-plugin-html": "^6.0.0",
"fried-twinkie": "^0.2.2",
"polylint": "^2.10.4",
"polymer-cli": "^1.9.11",
"typescript": "^2.x.x",
"web-component-tester": "^6.5.0"
},

View File

@ -45,6 +45,23 @@ filegroup(
),
)
filegroup(
name = "pg_code_without_test",
srcs = glob(
[
"**/*.html",
"**/*.js",
],
exclude = [
"bower_components/**",
"**/*_test.html",
"embed/test.html",
"test/**",
"samples/**",
],
),
)
filegroup(
name = "bower_components",
srcs = glob(
@ -108,7 +125,7 @@ sh_test(
size = "large",
srcs = ["polylint_test.sh"],
data = [
":pg_code",
":pg_code_without_test",
"//polygerrit-ui:polygerrit_components.bower_components.zip",
],
# Should not run sandboxed.

View File

@ -8,13 +8,21 @@ if [[ -z "$npm_bin" ]]; then
exit 1
fi
npx_bin=$(which npx)
if [[ -z "$npx_bin" ]]; then
echo "NPX must be on the path."
echo "> npm i -g npx"
node_bin=$(which node)
if [[ -z "$node_bin" ]]; then
echo "node must be on the path."
exit 1
fi
polymer_bin=$(which polymer)
if [[ -z "$polymer_bin" ]]; then
polymer_bin=$(abs_path ./node_modules/polymer-cli/bin/polymer.js);
fi
if [[ -z "$polymer_bin" ]]; then
echo "polymer must be set or polymer-cli locally installed (npm install polymer-cli)."
exit 1
fi
unzip -o polygerrit-ui/polygerrit_components.bower_components.zip -d polygerrit-ui/app
npx polylint --root polygerrit-ui/app --input elements/gr-app.html --b 'bower_components' --verbose
$polymer_bin lint --root polygerrit-ui/app --entrypoint polygerrit-ui/app/elements/gr-app.html --component-dir 'polygerrit-ui/app/bower_components' --verbose --rules polymer-2-hybrid --sources "polygerrit-ui/app/**/*"