Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-02 21:07:42 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-02 21:07:42 +0300
commit7b52c7cb634ef7047d30b0337fe477bcdcedf41d (patch)
tree374ca9e908204488422046f10e340d1500780362 /scripts
parentb375c6c05fbd03aea33a9ee9f82e678bdaa8c3cc (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts')
-rw-r--r--scripts/frontend/block_dependencies.js21
-rwxr-xr-xscripts/static-analysis1
2 files changed, 22 insertions, 0 deletions
diff --git a/scripts/frontend/block_dependencies.js b/scripts/frontend/block_dependencies.js
new file mode 100644
index 00000000000..c9257c9f72b
--- /dev/null
+++ b/scripts/frontend/block_dependencies.js
@@ -0,0 +1,21 @@
+const path = require('path');
+const packageJson = require(path.join(process.cwd(), 'package.json'));
+const blockedDependencies = packageJson.blockedDependencies || {};
+const dependencies = packageJson.dependencies;
+const devDependencies = packageJson.devDependencies;
+const blockedDependenciesNames = Object.keys(blockedDependencies);
+const blockedDependenciesFound = blockedDependenciesNames.filter(
+ blockedDependency => dependencies[blockedDependency] || devDependencies[blockedDependency],
+);
+
+if (blockedDependenciesFound.length) {
+ console.log('The following package.json dependencies are not allowed:');
+
+ blockedDependenciesFound.forEach(blockedDependency => {
+ const infoLink = blockedDependencies[blockedDependency];
+
+ console.log(`- ${blockedDependency}: See ${infoLink} for more information.`);
+ });
+
+ process.exit(-1);
+}
diff --git a/scripts/static-analysis b/scripts/static-analysis
index 251462fad33..ede29b85b8d 100755
--- a/scripts/static-analysis
+++ b/scripts/static-analysis
@@ -45,6 +45,7 @@ def jobs_to_run(node_index, node_total)
%w[yarn run eslint],
%w[yarn run stylelint],
%w[yarn run prettier-all],
+ %w[yarn run block-dependencies],
%w[bundle exec rubocop --parallel],
%w[scripts/lint-conflicts.sh],
%w[scripts/lint-rugged],