diff --git a/package.json b/package.json index 24ed747f427..10c28e927b3 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "count-rules": "node tools/count-rules.js", "_:bridge:copy-protofiles": "cpy --flat packages/jsts/src/parsers/estree.proto sonar-plugin/bridge/src/main/protobuf && cpy --flat packages/jsts/src/parsers/estree.proto lib/jsts/src/parsers", "_:bridge:clear": "rimraf --glob lib/*", - "_:plugin:prepare-bridge": "npm pack && node tools/check-distribution-filepath-length.cjs && npm run _:plugin:copy-bridge && npm run generate-rules-list", + "_:plugin:prepare-bridge": "npm pack && npm run _:plugin:copy-bridge && npm run generate-rules-list", "_:plugin-fetch-node": "node tools/fetch-node/scripts/wrapper.mjs", "_:plugin:pre-build": "npm run _:plugin:prepare-bridge && npm run _:plugin-fetch-node", "_:plugin:copy-bridge": "cpy sonarjs-1.0.0.tgz sonar-plugin/sonar-javascript-plugin/target/classes && cpy sonarjs-1.0.0.tgz sonar-plugin/standalone/target/classes", diff --git a/tools/check-distribution-filepath-length.cjs b/tools/check-distribution-filepath-length.cjs deleted file mode 100644 index e6e725cff3f..00000000000 --- a/tools/check-distribution-filepath-length.cjs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * SonarQube JavaScript Plugin - * Copyright (C) 2011-2024 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -const tar = require('tar'); - -const PACKAGE_FILENAME = 'sonarjs-1.0.0.tgz'; -const MAX_FILEPATH = 164; - -let longestLength = 0; -let longestFilepath = ''; - -tar.list({ - file: PACKAGE_FILENAME, - sync: true, - onentry: file => { - if (file.path.length > longestLength) { - longestLength = file.path.length; - longestFilepath = file.path; - } - }, -}); - -if (longestLength > MAX_FILEPATH) { - console.log( - `File length in generated ${PACKAGE_FILENAME} is longer than the accepted ${MAX_FILEPATH} characters`, - ); - console.log(`File length is too long at ${longestLength} characters in ${longestFilepath}`); - process.exitCode = 1; -}