Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[STAL-2831] Add YAML + configuration method #507

Merged
merged 4 commits into from
Sep 4, 2024
Merged

[STAL-2831] Add YAML + configuration method #507

merged 4 commits into from
Sep 4, 2024

Conversation

juli1
Copy link
Collaborator

@juli1 juli1 commented Sep 3, 2024

What problems are you trying to solve?

  1. Default YAML rules are not being pulled
  2. We do not show how the analyzer is configured when using remote configuration.

What is your solution?

  1. Add a ConfigMethod that indicates how the analyzer is configured (file, remote or nothing)
  2. Add YAML in the list of default languages

Testing

With no remote config or file

Configuration
=============
version                : 0.4.2
revision               : development
config method          : none (no local file and no remote configuration)
cores available        : 10
cores used             : 8
#static analysis rules : 880
source directory       : /Users/julien.delange/git/tree-sitter-xml
subdirectories         :
output file            : /Users/julien.delange/test.sarif
secrets enabled        : false
output format          : sarif
ignore paths           : Cargo.lock,target/,build/,prebuilds/,node_modules/,.build/,Package.resolved,go.sum,_obj/,.venv/,dist/,*.egg-info,*.whl,*.a,*.so,*.so.*,*.dylib,*.dll,*.pc,/examples/*/,dsl.d.ts,*.wasm,*.obj,*.o,**/node_modules/**/*,**/jspm_packages/**/*,**/.next/**/*,**/.vuepress/**/*,**/venv/**/*,**/__pycache__/**/*,**/_vendor/bundle/ruby/**/*,**/.vendor/bundle/ruby/**/*,**/.bundle/**/*,**/.gradle/**/*
only paths             : all paths
ignore gitignore       : false
use debug              : false
use staging            : true
ignore gen files       : true
rules languages        : ruby,python,dockerfile,go,yaml,c#,php,javascript,java,typescript
max file size          : 200 kb

With remote config

Configuration
=============
version                : 0.4.2
revision               : development
config method          : remote configuration
cores available        : 10
cores used             : 8
#static analysis rules : 98
source directory       : /Users/julien.delange/git/datadog-static-analyzer
subdirectories         :
output file            : /Users/julien.delange/test.sarif
secrets enabled        : false
output format          : sarif
ignore paths           : debug/,target/,Cargo.lock,**/*.rs.bk,*.pdb,*~,crates/static-analysis-kernel/.vendor/,.idea,venv,**/node_modules/**/*,**/jspm_packages/**/*,**/.next/**/*,**/.vuepress/**/*,**/venv/**/*,**/__pycache__/**/*,**/_vendor/bundle/ruby/**/*,**/.vendor/bundle/ruby/**/*,**/.bundle/**/*,**/.gradle/**/*
only paths             : all paths
ignore gitignore       : false
use debug              : false
use staging            : true
ignore gen files       : true
rules languages        : go,python
max file size          : 200 kb
Analyzing 2 Python files using 59 rules

With local config

Configuration
=============
version                : 0.4.2
revision               : development
config method          : local config file (static-analysis.datadog.[yml|yaml])
cores available        : 10
cores used             : 8
#static analysis rules : 59
source directory       : /Users/julien.delange/git/tree-sitter-xml
subdirectories         :
output file            : /Users/julien.delange/test.sarif
secrets enabled        : false
output format          : sarif
ignore paths           : Cargo.lock,target/,build/,prebuilds/,node_modules/,.build/,Package.resolved,go.sum,_obj/,.venv/,dist/,*.egg-info,*.whl,*.a,*.so,*.so.*,*.dylib,*.dll,*.pc,/examples/*/,dsl.d.ts,*.wasm,*.obj,*.o,**/node_modules/**/*,**/jspm_packages/**/*,**/.next/**/*,**/.vuepress/**/*,**/venv/**/*,**/__pycache__/**/*,**/_vendor/bundle/ruby/**/*,**/.vendor/bundle/ruby/**/*,**/.bundle/**/*,**/.gradle/**/*
only paths             : all paths
ignore gitignore       : false
use debug              : false
use staging            : true
ignore gen files       : true
rules languages        : python
max file size          : 200 kb

@juli1 juli1 requested a review from a team as a code owner September 3, 2024 19:57
@juli1 juli1 requested a review from amaanq September 3, 2024 19:57
crates/bins/src/bin/datadog-static-analyzer-git-hook.rs Outdated Show resolved Hide resolved
crates/bins/src/bin/datadog-static-analyzer.rs Outdated Show resolved Hide resolved
@juli1 juli1 merged commit 066f9d1 into main Sep 4, 2024
64 checks passed
@jasonforal jasonforal deleted the juli1/STAL-2831 branch November 8, 2024 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants