Skip to content

Commit

Permalink
Ops: Updated DevSkim to have a default configuration file and reduce …
Browse files Browse the repository at this point in the history
…errors (closes #3017) (#3024)

* Ops: Updated DevSkim to have a default configuration file and reduce errors (closes #3017)

* Added missing directive for default devskim configuration file

* Updated changelog with devskim config addition
  • Loading branch information
andrewvaughan authored Oct 20, 2023
1 parent ce5706e commit ab7e69c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l
- Fixes
- build.py: Remove exclusivity between pip, gem & cargo packages
- Salesforce linters: Switch sfdx-cli to @salesforce/cli
- Added default `.devskim.json` to mitigate errors introduced when no config exists

- Doc
- Display list of articles from newest to oldest
Expand Down
3 changes: 3 additions & 0 deletions TEMPLATES/.devskim.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"Globs": ["**/.git/**", "**/megalinter-reports/**"]
}
10 changes: 8 additions & 2 deletions docs/descriptors/repository_devskim.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,22 @@ description: How to use devskim (configure, ignore files, ignore errors, help &
# <a href="https://github.com/microsoft/DevSkim" target="blank" title="Visit linter Web Site"><img src="https://github.com/microsoft/DevSkim/raw/main/media/devskim_logo.svg" alt="devskim" height="100px" class="megalinter-logo"></a>devskim
[![GitHub stars](https://img.shields.io/github/stars/microsoft/DevSkim?cacheSeconds=3600)](https://github.com/microsoft/DevSkim) ![sarif](https://shields.io/badge/-SARIF-orange) [![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/microsoft/DevSkim?sort=semver)](https://github.com/microsoft/DevSkim/releases) [![GitHub last commit](https://img.shields.io/github/last-commit/microsoft/DevSkim)](https://github.com/microsoft/DevSkim/commits) [![GitHub commit activity](https://img.shields.io/github/commit-activity/y/microsoft/DevSkim)](https://github.com/microsoft/DevSkim/graphs/commit-activity/) [![GitHub contributors](https://img.shields.io/github/contributors/microsoft/DevSkim)](https://github.com/microsoft/DevSkim/graphs/contributors/)

Use `--ignore-globs` to ignore files and/or folders
Use the `Globs` configuration in a `.devskim.json` configuration file to ignore files and/or folders.

Example:
`REPOSITORY_DEVSKIM_ARGUMENTS: ['--ignore-globs','**/megalinter-reports/**,**/.git/**,**/bin/**']`

```json
{
"Globs": ["**/.git/**", "**/megalinter-reports/**"]
}
```

## devskim documentation

- Version in MegaLinter: **1.0.23**
- Visit [Official Web Site](https://github.com/microsoft/DevSkim#readme){target=_blank}
- See [How to configure devskim rules](https://github.com/microsoft/DevSkim/wiki/Analyze-Command){target=_blank}
- If custom `.devskim.json` config file isn't found, [.devskim.json](https://github.com/oxsecurity/megalinter/tree/main/TEMPLATES/.devskim.json){target=_blank} will be used
- See [How to ignore files and directories with devskim](https://github.com/microsoft/DevSkim/wiki/Analyze-Command){target=_blank}

[![DevSkim - GitHub](https://gh-card.dev/repos/microsoft/DevSkim.svg?fullname=)](https://github.com/microsoft/DevSkim){target=_blank}
Expand Down
13 changes: 11 additions & 2 deletions megalinter/descriptors/repository.megalinter-descriptor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,26 @@ linters:
- security
ignore_for_flavor_suggestions: true
linter_text: |
Use `--ignore-globs` to ignore files and/or folders
If you need to ignore folders,files or file extensions, use glob expressions `Glob` property of local `.devskim.json` file
Example:
`REPOSITORY_DEVSKIM_ARGUMENTS: ['--ignore-globs','**/megalinter-reports/**,**/.git/**,**/bin/**']`
```json
{
Glob: [
"**/.git/**",
"**/megalinter-reports/**"
]
}
```
linter_url: https://github.com/microsoft/DevSkim
linter_repo: https://github.com/microsoft/DevSkim
linter_speed: 1
linter_rules_configuration_url: https://github.com/microsoft/DevSkim/wiki/Analyze-Command
linter_rules_ignore_config_url: https://github.com/microsoft/DevSkim/wiki/Analyze-Command
linter_image_url: https://github.com/microsoft/DevSkim/raw/main/media/devskim_logo.svg
linter_icon_png_url: https://raw.githubusercontent.com/oxsecurity/megalinter/main/docs/assets/icons/linters/devskim.png
config_file_name: .devskim.json
cli_lint_mode: project
cli_lint_extra_args:
- analyze
Expand Down

0 comments on commit ab7e69c

Please sign in to comment.