From 73139ab0393c036940fe247b2f90a0e77966a1f8 Mon Sep 17 00:00:00 2001 From: Samuel Bodin <1637651+bodinsamuel@users.noreply.github.com> Date: Fri, 3 Nov 2023 11:28:18 +0100 Subject: [PATCH] fix(rules): add more pkg for languages --- src/rules/spec/deno/index.ts | 1 + .../__snapshots__/component.test.ts.snap | 102 ++++++++++++++++++ .../__snapshots__/component.test.ts.snap | 20 ++++ src/rules/spec/golang/index.ts | 6 +- src/rules/spec/nodejs/index.ts | 6 +- src/rules/spec/php/index.ts | 15 ++- src/rules/spec/ruby/index.ts | 5 +- src/rules/spec/rust/index.ts | 6 ++ 8 files changed, 157 insertions(+), 4 deletions(-) diff --git a/src/rules/spec/deno/index.ts b/src/rules/spec/deno/index.ts index 2cc1a364..44f3856d 100644 --- a/src/rules/spec/deno/index.ts +++ b/src/rules/spec/deno/index.ts @@ -9,6 +9,7 @@ register({ files: ['deno.jsonc', 'deno.json', 'deno.lock'], dependencies: [ { type: 'docker', name: /denoland\/deno/, example: 'denoland/deno:0.0.0' }, + { type: 'githubAction', name: 'denoland/setup-deno' }, ], detect: detectDenoLockfile, }); diff --git a/src/rules/spec/docker/__snapshots__/component.test.ts.snap b/src/rules/spec/docker/__snapshots__/component.test.ts.snap index c5ddf82a..e63a7d16 100644 --- a/src/rules/spec/docker/__snapshots__/component.test.ts.snap +++ b/src/rules/spec/docker/__snapshots__/component.test.ts.snap @@ -46,6 +46,7 @@ exports[`docker > should match everything 1`] = ` "ghost", "gitguardian", "goacmelego", + "golang", "golangcilint", "grafana", "haproxy", @@ -88,6 +89,7 @@ exports[`docker > should match everything 1`] = ` "redis", "rethinkdb", "ruby", + "rust", "sentry", "slack", "snyk", @@ -233,6 +235,11 @@ exports[`docker > should match everything 2`] = ` "bitnami/discourse", "0.0.0", ], + [ + "docker", + "bitnami/golang", + "0.0.0", + ], [ "docker", "bitnami/kafka", @@ -278,6 +285,21 @@ exports[`docker > should match everything 2`] = ` "bitnami/nginx-ingress-controller", "0.0.0", ], + [ + "docker", + "bitnami/node", + "0.0.0", + ], + [ + "docker", + "bitnami/php", + "0.0.0", + ], + [ + "docker", + "bitnami/php-fpm", + "0.0.0", + ], [ "docker", "bitnami/postgresql", @@ -363,26 +385,66 @@ exports[`docker > should match everything 2`] = ` "cimg/azure", "0.0.0", ], + [ + "docker", + "cimg/node", + "0.0.0", + ], + [ + "docker", + "cimg/php", + "0.0.0", + ], [ "docker", "cimg/postgres", "0.0.0", ], + [ + "docker", + "cimg/rust", + "0.0.0", + ], + [ + "docker", + "circleci/golang", + "0.0.0", + ], [ "docker", "circleci/mongo", "0.0.0", ], + [ + "docker", + "circleci/node", + "0.0.0", + ], + [ + "docker", + "circleci/php", + "0.0.0", + ], [ "docker", "circleci/postgres", "0.0.0", ], + [ + "docker", + "circleci/rust", + "0.0.0", + ], [ "docker", "clickhouse/clickhouse-server", "0.0.0", ], + [ + "docker", + "composer", + "0.0.0", + ], [ "docker", "consul", @@ -473,6 +535,11 @@ exports[`docker > should match everything 2`] = ` "goacme/lego", "0.0.0", ], + [ + "docker", + "golang", + "0.0.0", + ], [ "docker", "golangci/golangci-lint", @@ -758,6 +825,16 @@ exports[`docker > should match everything 2`] = ` "oceanbase/oceanbase-ce", "0.0.0", ], + [ + "docker", + "okteto/node", + "0.0.0", + ], + [ + "docker", + "okteto/php", + "0.0.0", + ], [ "docker", "percona", @@ -768,6 +845,11 @@ exports[`docker > should match everything 2`] = ` "php", "0.0.0", ], + [ + "docker", + "php-zendserver", + "0.0.0", + ], [ "docker", "pingcap/tidb", @@ -848,6 +930,16 @@ exports[`docker > should match everything 2`] = ` "ruby", "0.0.0", ], + [ + "docker", + "rust", + "0.0.0", + ], + [ + "docker", + "rustlang/rust", + "0.0.0", + ], [ "docker", "sentry", @@ -1048,6 +1140,16 @@ exports[`docker > should match everything 2`] = ` "webdevops/liquibase", "0.0.0", ], + [ + "docker", + "webdevops/php-apache", + "0.0.0", + ], + [ + "docker", + "webdevops/php-nginx", + "0.0.0", + ], [ "docker", "wodby/nginx", diff --git a/src/rules/spec/githubActions/__snapshots__/component.test.ts.snap b/src/rules/spec/githubActions/__snapshots__/component.test.ts.snap index 845f913e..bb3f026d 100644 --- a/src/rules/spec/githubActions/__snapshots__/component.test.ts.snap +++ b/src/rules/spec/githubActions/__snapshots__/component.test.ts.snap @@ -390,6 +390,11 @@ exports[`docker > should match all dependencies 2`] = ` "denoland/deployctl", "1", ], + [ + "githubAction", + "denoland/setup-deno", + "1", + ], [ "githubAction", "digitalocean/action-doctl", @@ -595,6 +600,11 @@ exports[`docker > should match all dependencies 2`] = ` "planetscale/create-branch-action", "1", ], + [ + "githubAction", + "ramsey/composer-install", + "1", + ], [ "githubAction", "red-gate/flyway-hub-migration-test", @@ -610,6 +620,11 @@ exports[`docker > should match all dependencies 2`] = ` "rollbar/github-deploy-action", "1", ], + [ + "githubAction", + "ruby/setup-ruby", + "1", + ], [ "githubAction", "samuelmeuli/action-electron-builder", @@ -620,6 +635,11 @@ exports[`docker > should match all dependencies 2`] = ` "scaleway/action-scw", "1", ], + [ + "githubAction", + "shivammathur/setup-php", + "1", + ], [ "githubAction", "slackapi/slack-github-action", diff --git a/src/rules/spec/golang/index.ts b/src/rules/spec/golang/index.ts index 35f28af7..e172da77 100644 --- a/src/rules/spec/golang/index.ts +++ b/src/rules/spec/golang/index.ts @@ -10,5 +10,9 @@ register({ files: ['go.mod', 'main.go'], extensions: ['.go'], detect: [detectGolangLockfile, detectGolangComponent], - dependencies: [], + dependencies: [ + { type: 'docker', name: 'golang' }, + { type: 'docker', name: 'circleci/golang' }, + { type: 'docker', name: 'bitnami/golang' }, + ], }); diff --git a/src/rules/spec/nodejs/index.ts b/src/rules/spec/nodejs/index.ts index 8b84ce89..e690cfd6 100644 --- a/src/rules/spec/nodejs/index.ts +++ b/src/rules/spec/nodejs/index.ts @@ -9,7 +9,11 @@ register({ files: ['package.json', '.nvmrc'], dependencies: [ { type: 'docker', name: /nodejs/, example: 'nodejs:0.0.0' }, - { type: 'docker', name: 'node', example: 'node:0.0.0' }, + { type: 'docker', name: 'node' }, + { type: 'docker', name: 'circleci/node' }, + { type: 'docker', name: 'cimg/node' }, + { type: 'docker', name: 'bitnami/node' }, + { type: 'docker', name: 'okteto/node' }, ], detect: detectNodeComponent, }); diff --git a/src/rules/spec/php/index.ts b/src/rules/spec/php/index.ts index a024d9db..8eb0124e 100644 --- a/src/rules/spec/php/index.ts +++ b/src/rules/spec/php/index.ts @@ -8,6 +8,19 @@ register({ type: 'language', files: ['composer.json', 'composer.lock'], extensions: ['.php', '.php3', '.php4', '.php5'], - dependencies: [{ type: 'docker', name: 'php', example: 'php:0.0.0' }], detect: detectPhpComponent, + dependencies: [ + { type: 'docker', name: 'php' }, + { type: 'docker', name: 'circleci/php' }, + { type: 'docker', name: 'cimg/php' }, + { type: 'docker', name: 'bitnami/php' }, + { type: 'docker', name: 'bitnami/php-fpm' }, + { type: 'docker', name: 'okteto/php' }, + { type: 'docker', name: 'composer' }, + { type: 'docker', name: 'php-zendserver' }, + { type: 'docker', name: 'webdevops/php-apache' }, + { type: 'docker', name: 'webdevops/php-nginx' }, + { type: 'githubAction', name: 'shivammathur/setup-php' }, + { type: 'githubAction', name: 'ramsey/composer-install' }, + ], }); diff --git a/src/rules/spec/ruby/index.ts b/src/rules/spec/ruby/index.ts index f0ee19ac..07a9bc6e 100644 --- a/src/rules/spec/ruby/index.ts +++ b/src/rules/spec/ruby/index.ts @@ -8,6 +8,9 @@ register({ type: 'language', files: ['Gemfile', 'Rakefile', '.ruby-version'], extensions: ['.rb', '.rbx', '.ru', '.ruby'], - dependencies: [{ type: 'docker', name: /ruby/, example: 'ruby:0.0.0' }], + dependencies: [ + { type: 'docker', name: /ruby/, example: 'ruby:0.0.0' }, + { type: 'githubAction', name: 'ruby/setup-ruby' }, + ], detect: detectRubyLockfile, }); diff --git a/src/rules/spec/rust/index.ts b/src/rules/spec/rust/index.ts index 9ea10090..a6aa1183 100644 --- a/src/rules/spec/rust/index.ts +++ b/src/rules/spec/rust/index.ts @@ -8,5 +8,11 @@ register({ type: 'language', files: ['Cargo.toml'], extensions: ['.rs', '.rs.in'], + dependencies: [ + { type: 'docker', name: 'rust' }, + { type: 'docker', name: 'cimg/rust' }, + { type: 'docker', name: 'circleci/rust' }, + { type: 'docker', name: 'rustlang/rust' }, + ], detect: [detectRustComponent], });