Skip to content

Commit

Permalink
fix(rules): add more pkg for languages
Browse files Browse the repository at this point in the history
  • Loading branch information
bodinsamuel committed Nov 3, 2023
1 parent 38eda05 commit 73139ab
Show file tree
Hide file tree
Showing 8 changed files with 157 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/rules/spec/deno/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
102 changes: 102 additions & 0 deletions src/rules/spec/docker/__snapshots__/component.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ exports[`docker > should match everything 1`] = `
"ghost",
"gitguardian",
"goacmelego",
"golang",
"golangcilint",
"grafana",
"haproxy",
Expand Down Expand Up @@ -88,6 +89,7 @@ exports[`docker > should match everything 1`] = `
"redis",
"rethinkdb",
"ruby",
"rust",
"sentry",
"slack",
"snyk",
Expand Down Expand Up @@ -233,6 +235,11 @@ exports[`docker > should match everything 2`] = `
"bitnami/discourse",
"0.0.0",
],
[
"docker",
"bitnami/golang",
"0.0.0",
],
[
"docker",
"bitnami/kafka",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -473,6 +535,11 @@ exports[`docker > should match everything 2`] = `
"goacme/lego",
"0.0.0",
],
[
"docker",
"golang",
"0.0.0",
],
[
"docker",
"golangci/golangci-lint",
Expand Down Expand Up @@ -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",
Expand All @@ -768,6 +845,11 @@ exports[`docker > should match everything 2`] = `
"php",
"0.0.0",
],
[
"docker",
"php-zendserver",
"0.0.0",
],
[
"docker",
"pingcap/tidb",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
20 changes: 20 additions & 0 deletions src/rules/spec/githubActions/__snapshots__/component.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,11 @@ exports[`docker > should match all dependencies 2`] = `
"denoland/deployctl",
"1",
],
[
"githubAction",
"denoland/setup-deno",
"1",
],
[
"githubAction",
"digitalocean/action-doctl",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
6 changes: 5 additions & 1 deletion src/rules/spec/golang/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
],
});
6 changes: 5 additions & 1 deletion src/rules/spec/nodejs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
15 changes: 14 additions & 1 deletion src/rules/spec/php/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
],
});
5 changes: 4 additions & 1 deletion src/rules/spec/ruby/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
6 changes: 6 additions & 0 deletions src/rules/spec/rust/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
});

0 comments on commit 73139ab

Please sign in to comment.