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

feat(gitleaks): add initial support for gitleaks #4589

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pbnj
Copy link
Contributor

@pbnj pbnj commented Aug 16, 2023

Closes #4588

TODO:

  • add docs
  • add tests

@pbnj
Copy link
Contributor Author

pbnj commented Aug 16, 2023

Here are some preliminary results...

Shell

Screenshot 2023-08-15 at 8 11 59 PM

:ALEInfo

Expand
 Current Filetype: sh
Available Linters: ['bashate', 'cspell', 'gitleaks', 'language_server', 'shell', 'shellcheck']
  Enabled Linters: ['bashate', 'cspell', 'gitleaks', 'language_server', 'shell', 'shellcheck']
  Ignored Linters: []
 Suggested Fixers: 
  'remove_trailing_lines' - Remove all blank lines at the end of a file.
  'shfmt' - Fix sh files with shfmt.
  'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
 Linter Variables:

let g:ale_sh_bashate_executable = 'bashate'
let g:ale_sh_bashate_options = ''
let g:ale_sh_language_server_executable = 'bash-language-server'
let g:ale_sh_language_server_use_global = 0
let g:ale_sh_shell_default_shell = 'bash'
let g:ale_sh_shellcheck_change_directory = 1
let g:ale_sh_shellcheck_dialect = 'auto'
let g:ale_sh_shellcheck_exclusions = ''
let g:ale_sh_shellcheck_executable = 'shellcheck'
let g:ale_sh_shellcheck_options = ''
 Global Variables:

let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = 100
let g:ale_completion_enabled = 1
let g:ale_completion_max_suggestions = 50
let g:ale_disable_lsp = 0
let g:ale_echo_cursor = 0
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%code: %%s'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 1
let g:ale_fixers = {'*': ['remove_trailing_lines', 'trim_whitespace']}
let b:ale_fixers = ['shfmt']
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_insert_leave = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'normal'
let g:ale_linter_aliases = {}
let g:ale_linters = {}
let g:ale_linters_explicit = 0
let g:ale_linters_ignore = {}
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '%code: %%s'
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = -1
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 0
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_root = {}
let g:ale_set_balloons = 0
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = '>>'
let g:ale_sign_info = '--'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = '>>'
let g:ale_sign_style_warning = '--'
let g:ale_sign_warning = '--'
let g:ale_sign_highlight_linenrs = 0
let g:ale_statusline_format = v:null
let g:ale_type_map = {}
let g:ale_use_neovim_diagnostics_api = 0
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 'all'
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
  Command History:

(executable check - failure) bashate
(executable check - failure) cspell
(finished - exit code 1) ['/opt/homebrew/bin/bash', '-c', '''gitleaks'' detect --no-git --no-color --no-banner --redact --verbose --source=''/Users/peter.benjamin/.vim/plugged/ale/tmp/env''']

<<<OUTPUT STARTS>>>
Finding:     ACCESS_KEY_ID=REDACTED
Secret:      REDACTED
RuleID:      generic-api-key
Entropy:     3.546594
File:        /Users/peter.benjamin/.vim/plugged/ale/tmp/env
Line:        1
Fingerprint: /Users/peter.benjamin/.vim/plugged/ale/tmp/env:generic-api-key:1

<<<OUTPUT ENDS>>>

(executable check - failure) bash-language-server
(executable check - success) sh
(finished - exit code 0) ['/opt/homebrew/bin/bash', '-c', 'sh -n ''/var/folders/n3/z85vhgns0n98543krh_3n63h0000gq/T/vr8lhWI/116/env''']

<<<NO OUTPUT RETURNED>>>

(executable check - success) shellcheck
(finished - exit code 0) ['/opt/homebrew/bin/bash', '-c', 'cd ''/Users/peter.benjamin/.vim/plugged/ale/tmp'' && ''shellcheck'' --version']

<<<OUTPUT STARTS>>>
ShellCheck - shell script analysis tool
version: 0.9.0
license: GNU General Public License, version 3
website: https://www.shellcheck.net
<<<OUTPUT ENDS>>>

(finished - exit code 1) ['/opt/homebrew/bin/bash', '-c', 'cd ''/Users/peter.benjamin/.vim/plugged/ale/tmp'' && ''shellcheck'' -s sh -x -f gcc - < ''/var/folders/n3/z85vhgns0n98543krh_3n63h0000gq/T/vr8lhWI/117/env''']

<<<OUTPUT STARTS>>>
-:1:1: warning: AWS_ACCESS_KEY_ID appears unused. Verify use (or export if used externally). [SC2034]
<<<OUTPUT ENDS>>>

Terraform

Screenshot 2023-08-15 at 8 16 10 PM

:ALEInfo

Expand
 Current Filetype: terraform
Available Linters: ['checkov', 'gitleaks', 'terraform', 'terraform_ls', 'terraform_lsp', 'tflint', 'tfsec']
  Enabled Linters: ['gitleaks', 'terraform', 'terraform_ls', 'tflint']
  Ignored Linters: []
 Suggested Fixers: 
  'remove_trailing_lines' - Remove all blank lines at the end of a file.
  'terraform' - Fix tf and hcl files with terraform fmt.
  'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
 Linter Variables:

let g:ale_terraform_fmt_executable = 'terraform'
let g:ale_terraform_fmt_options = ''
let g:ale_terraform_langserver_executable = 'terraform-lsp'
let g:ale_terraform_langserver_options = ''
let g:ale_terraform_ls_executable = 'terraform-ls'
let g:ale_terraform_ls_options = ''
let g:ale_terraform_terraform_executable = 'terraform'
let g:ale_terraform_tflint_executable = 'tflint'
let g:ale_terraform_tflint_options = ''
 Global Variables:

let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = 100
let g:ale_completion_enabled = 1
let g:ale_completion_max_suggestions = 50
let g:ale_disable_lsp = 0
let g:ale_echo_cursor = 0
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%code: %%s'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 1
let g:ale_fixers = {'*': ['remove_trailing_lines', 'trim_whitespace']}
let b:ale_fixers = ['terraform', 'remove_trailing_lines', 'trim_whitespace']
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_insert_leave = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'normal'
let g:ale_linter_aliases = {}
let g:ale_linters = {}
let b:ale_linters = ['terraform', 'tflint', 'terraform_ls', 'snyk', 'gitleaks']
let g:ale_linters_explicit = 0
let g:ale_linters_ignore = {}
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '%code: %%s'
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = -1
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 0
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_root = {}
let g:ale_set_balloons = 0
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = '>>'
let g:ale_sign_info = '--'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = '>>'
let g:ale_sign_style_warning = '--'
let g:ale_sign_warning = '--'
let g:ale_sign_highlight_linenrs = 0
let g:ale_statusline_format = v:null
let g:ale_type_map = {}
let g:ale_use_neovim_diagnostics_api = 0
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 'all'
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
 LSP Error Messages:

(Errors for terraform_ls)
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
Failed to find project root, language server won't start.
  Command History:

(finished - exit code 0) ['/opt/homebrew/bin/bash', '-c', '''terraform'' validate -no-color -json  < ''/var/folders/n3/z85vhgns0n98543krh_3n63h0000gq/T/vr8lhWI/88/test.tf''']

<<<OUTPUT STARTS>>>
{
  "format_version": "1.0",
  "valid": true,
  "error_count": 0,
  "warning_count": 0,
  "diagnostics": []
}
<<<OUTPUT ENDS>>>

(finished - exit code 2) ['/opt/homebrew/bin/bash', '-c', 'cd ''/Users/peter.benjamin/.vim/plugged/ale/tmp'' && ''tflint'' -f json < ''/var/folders/n3/z85vhgns0n98543krh_3n63h0000gq/T/vr8lhWI/89/test.tf''']

<<<OUTPUT STARTS>>>
{"issues":[{"rule":{"name":"terraform_required_version","severity":"warning","link":"https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.4.0/docs/rules/terraform_required_version.md"},"message":"terraform \"required_version\" attribute is required","range":{"filename":"","start":{"line":0,"column":0},"end":{"line":0,"column":0}},"callers":[]},{"rule":{"name":"terraform_required_providers","severity":"warning","link":"https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.4.0/docs/rules/terraform_required_providers.md"},"message":"Missing version constraint for provider \"null\" in `required_providers`","range":{"filename":"test.tf","start":{"line":1,"column":1},"end":{"line":1,"column":32}},"callers":[]}],"errors":[]}
<<<OUTPUT ENDS>>>

(finished - exit code 0) ['/opt/homebrew/bin/bash', '-c', '''terraform'' validate -no-color -json  < ''/var/folders/n3/z85vhgns0n98543krh_3n63h0000gq/T/vr8lhWI/90/test.tf''']

<<<OUTPUT STARTS>>>
{
  "format_version": "1.0",
  "valid": true,
  "error_count": 0,
  "warning_count": 0,
  "diagnostics": []
}
<<<OUTPUT ENDS>>>

(finished - exit code 2) ['/opt/homebrew/bin/bash', '-c', 'cd ''/Users/peter.benjamin/.vim/plugged/ale/tmp'' && ''tflint'' -f json < ''/var/folders/n3/z85vhgns0n98543krh_3n63h0000gq/T/vr8lhWI/91/test.tf''']

<<<OUTPUT STARTS>>>
{"issues":[{"rule":{"name":"terraform_required_version","severity":"warning","link":"https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.4.0/docs/rules/terraform_required_version.md"},"message":"terraform \"required_version\" attribute is required","range":{"filename":"","start":{"line":0,"column":0},"end":{"line":0,"column":0}},"callers":[]},{"rule":{"name":"terraform_required_providers","severity":"warning","link":"https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.4.0/docs/rules/terraform_required_providers.md"},"message":"Missing version constraint for provider \"null\" in `required_providers`","range":{"filename":"test.tf","start":{"line":1,"column":1},"end":{"line":1,"column":32}},"callers":[]}],"errors":[]}
<<<OUTPUT ENDS>>>

(finished - exit code 0) ['/opt/homebrew/bin/bash', '-c', '''terraform'' validate -no-color -json  < ''/var/folders/n3/z85vhgns0n98543krh_3n63h0000gq/T/vr8lhWI/94/test.tf''']

<<<OUTPUT STARTS>>>
{
  "format_version": "1.0",
  "valid": true,
  "error_count": 0,
  "warning_count": 0,
  "diagnostics": []
}
<<<OUTPUT ENDS>>>

(finished - exit code 2) ['/opt/homebrew/bin/bash', '-c', 'cd ''/Users/peter.benjamin/.vim/plugged/ale/tmp'' && ''tflint'' -f json < ''/var/folders/n3/z85vhgns0n98543krh_3n63h0000gq/T/vr8lhWI/95/test.tf''']

<<<OUTPUT STARTS>>>
{"issues":[{"rule":{"name":"terraform_required_version","severity":"warning","link":"https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.4.0/docs/rules/terraform_required_version.md"},"message":"terraform \"required_version\" attribute is required","range":{"filename":"","start":{"line":0,"column":0},"end":{"line":0,"column":0}},"callers":[]},{"rule":{"name":"terraform_required_providers","severity":"warning","link":"https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.4.0/docs/rules/terraform_required_providers.md"},"message":"Missing version constraint for provider \"null\" in `required_providers`","range":{"filename":"test.tf","start":{"line":1,"column":1},"end":{"line":1,"column":32}},"callers":[]}],"errors":[]}
<<<OUTPUT ENDS>>>

(finished - exit code 0) ['/opt/homebrew/bin/bash', '-c', '''terraform'' fmt - < ''/var/folders/n3/z85vhgns0n98543krh_3n63h0000gq/T/vr8lhWI/98/test.tf''']
(finished - exit code 1) ['/opt/homebrew/bin/bash', '-c', '''gitleaks'' detect --no-git --no-color --no-banner --redact --verbose --source=''/Users/peter.benjamin/.vim/plugged/ale/tmp/test.tf''']

<<<OUTPUT STARTS>>>
Finding:     client_secret = "REDACTED"
Secret:      REDACTED
RuleID:      generic-api-key
Entropy:     4.651872
File:        /Users/peter.benjamin/.vim/plugged/ale/tmp/test.tf
Line:        2
Fingerprint: /Users/peter.benjamin/.vim/plugged/ale/tmp/test.tf:generic-api-key:2

<<<OUTPUT ENDS>>>

(finished - exit code 0) ['/opt/homebrew/bin/bash', '-c', '''terraform'' validate -no-color -json  < ''/var/folders/n3/z85vhgns0n98543krh_3n63h0000gq/T/vr8lhWI/99/test.tf''']

<<<OUTPUT STARTS>>>
{
  "format_version": "1.0",
  "valid": true,
  "error_count": 0,
  "warning_count": 0,
  "diagnostics": []
}
<<<OUTPUT ENDS>>>

(finished - exit code 2) ['/opt/homebrew/bin/bash', '-c', 'cd ''/Users/peter.benjamin/.vim/plugged/ale/tmp'' && ''tflint'' -f json < ''/var/folders/n3/z85vhgns0n98543krh_3n63h0000gq/T/vr8lhWI/100/test.tf''']

<<<OUTPUT STARTS>>>
{"issues":[{"rule":{"name":"terraform_required_version","severity":"warning","link":"https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.4.0/docs/rules/terraform_required_version.md"},"message":"terraform \"required_version\" attribute is required","range":{"filename":"","start":{"line":0,"column":0},"end":{"line":0,"column":0}},"callers":[]},{"rule":{"name":"terraform_required_providers","severity":"warning","link":"https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.4.0/docs/rules/terraform_required_providers.md"},"message":"Missing version constraint for provider \"null\" in `required_providers`","range":{"filename":"test.tf","start":{"line":1,"column":1},"end":{"line":1,"column":32}},"callers":[]}],"errors":[]}
<<<OUTPUT ENDS>>>

(finished - exit code 0) ['/opt/homebrew/bin/bash', '-c', '''terraform'' validate -no-color -json  < ''/var/folders/n3/z85vhgns0n98543krh_3n63h0000gq/T/vr8lhWI/101/test.tf''']

<<<OUTPUT STARTS>>>
{
  "format_version": "1.0",
  "valid": true,
  "error_count": 0,
  "warning_count": 0,
  "diagnostics": []
}
<<<OUTPUT ENDS>>>

(finished - exit code 2) ['/opt/homebrew/bin/bash', '-c', 'cd ''/Users/peter.benjamin/.vim/plugged/ale/tmp'' && ''tflint'' -f json < ''/var/folders/n3/z85vhgns0n98543krh_3n63h0000gq/T/vr8lhWI/102/test.tf''']

<<<OUTPUT STARTS>>>
{"issues":[{"rule":{"name":"terraform_required_version","severity":"warning","link":"https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.4.0/docs/rules/terraform_required_version.md"},"message":"terraform \"required_version\" attribute is required","range":{"filename":"","start":{"line":0,"column":0},"end":{"line":0,"column":0}},"callers":[]},{"rule":{"name":"terraform_required_providers","severity":"warning","link":"https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.4.0/docs/rules/terraform_required_providers.md"},"message":"Missing version constraint for provider \"null\" in `required_providers`","range":{"filename":"test.tf","start":{"line":1,"column":1},"end":{"line":1,"column":32}},"callers":[]}],"errors":[]}
<<<OUTPUT ENDS>>>

(finished - exit code 0) ['/opt/homebrew/bin/bash', '-c', '''terraform'' validate -no-color -json  < ''/var/folders/n3/z85vhgns0n98543krh_3n63h0000gq/T/vr8lhWI/109/test.tf''']

<<<OUTPUT STARTS>>>
{
  "format_version": "1.0",
  "valid": true,
  "error_count": 0,
  "warning_count": 0,
  "diagnostics": []
}
<<<OUTPUT ENDS>>>

(finished - exit code 2) ['/opt/homebrew/bin/bash', '-c', 'cd ''/Users/peter.benjamin/.vim/plugged/ale/tmp'' && ''tflint'' -f json < ''/var/folders/n3/z85vhgns0n98543krh_3n63h0000gq/T/vr8lhWI/110/test.tf''']

<<<OUTPUT STARTS>>>
{"issues":[{"rule":{"name":"terraform_required_version","severity":"warning","link":"https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.4.0/docs/rules/terraform_required_version.md"},"message":"terraform \"required_version\" attribute is required","range":{"filename":"","start":{"line":0,"column":0},"end":{"line":0,"column":0}},"callers":[]},{"rule":{"name":"terraform_required_providers","severity":"warning","link":"https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.4.0/docs/rules/terraform_required_providers.md"},"message":"Missing version constraint for provider \"null\" in `required_providers`","range":{"filename":"test.tf","start":{"line":1,"column":1},"end":{"line":1,"column":32}},"callers":[]}],"errors":[]}
<<<OUTPUT ENDS>>>

(finished - exit code 0) ['/opt/homebrew/bin/bash', '-c', '''terraform'' validate -no-color -json  < ''/var/folders/n3/z85vhgns0n98543krh_3n63h0000gq/T/vr8lhWI/111/test.tf''']

<<<OUTPUT STARTS>>>
{
  "format_version": "1.0",
  "valid": true,
  "error_count": 0,
  "warning_count": 0,
  "diagnostics": []
}
<<<OUTPUT ENDS>>>

(finished - exit code 2) ['/opt/homebrew/bin/bash', '-c', 'cd ''/Users/peter.benjamin/.vim/plugged/ale/tmp'' && ''tflint'' -f json < ''/var/folders/n3/z85vhgns0n98543krh_3n63h0000gq/T/vr8lhWI/112/test.tf''']

<<<OUTPUT STARTS>>>
{"issues":[{"rule":{"name":"terraform_required_version","severity":"warning","link":"https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.4.0/docs/rules/terraform_required_version.md"},"message":"terraform \"required_version\" attribute is required","range":{"filename":"","start":{"line":0,"column":0},"end":{"line":0,"column":0}},"callers":[]},{"rule":{"name":"terraform_required_providers","severity":"warning","link":"https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.4.0/docs/rules/terraform_required_providers.md"},"message":"Missing version constraint for provider \"null\" in `required_providers`","range":{"filename":"test.tf","start":{"line":1,"column":1},"end":{"line":1,"column":32}},"callers":[]}],"errors":[]}
<<<OUTPUT ENDS>>>

(finished - exit code 0) ['/opt/homebrew/bin/bash', '-c', '''terraform'' fmt - < ''/var/folders/n3/z85vhgns0n98543krh_3n63h0000gq/T/vr8lhWI/113/test.tf''']
(finished - exit code 1) ['/opt/homebrew/bin/bash', '-c', '''gitleaks'' detect --no-git --no-color --no-banner --redact --verbose --source=''/Users/peter.benjamin/.vim/plugged/ale/tmp/test.tf''']

<<<OUTPUT STARTS>>>
Finding:     client_secret = "REDACTED"
Secret:      REDACTED
RuleID:      generic-api-key
Entropy:     4.669569
File:        /Users/peter.benjamin/.vim/plugged/ale/tmp/test.tf
Line:        2
Fingerprint: /Users/peter.benjamin/.vim/plugged/ale/tmp/test.tf:generic-api-key:2

<<<OUTPUT ENDS>>>

(finished - exit code 0) ['/opt/homebrew/bin/bash', '-c', '''terraform'' validate -no-color -json  < ''/var/folders/n3/z85vhgns0n98543krh_3n63h0000gq/T/vr8lhWI/114/test.tf''']

<<<OUTPUT STARTS>>>
{
  "format_version": "1.0",
  "valid": true,
  "error_count": 0,
  "warning_count": 0,
  "diagnostics": []
}
<<<OUTPUT ENDS>>>

(finished - exit code 2) ['/opt/homebrew/bin/bash', '-c', 'cd ''/Users/peter.benjamin/.vim/plugged/ale/tmp'' && ''tflint'' -f json < ''/var/folders/n3/z85vhgns0n98543krh_3n63h0000gq/T/vr8lhWI/115/test.tf''']

<<<OUTPUT STARTS>>>
{"issues":[{"rule":{"name":"terraform_required_version","severity":"warning","link":"https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.4.0/docs/rules/terraform_required_version.md"},"message":"terraform \"required_version\" attribute is required","range":{"filename":"","start":{"line":0,"column":0},"end":{"line":0,"column":0}},"callers":[]},{"rule":{"name":"terraform_required_providers","severity":"warning","link":"https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.4.0/docs/rules/terraform_required_providers.md"},"message":"Missing version constraint for provider \"null\" in `required_providers`","range":{"filename":"test.tf","start":{"line":1,"column":1},"end":{"line":1,"column":32}},"callers":[]}],"errors":[]}
<<<OUTPUT ENDS>>>

Closes dense-analysis#4588

feat(gitleaks): add gitleaks linter for sh

fix(gitleaks): set lint_file for gitleaks

feat(gitleaks): add gitleaks support for multiple file-types

fix: add docs and support a few more filetypes

docs: add gitleaks docs

tests: add gitleaks handler & linter tests

docs(gitleaks): add missing docs

docs: fix toc & heading sorting

docs: fix toc issue
@pbnj pbnj force-pushed the feat/add-gitleaks branch from e1b1e6a to aba76d1 Compare August 16, 2023 05:49
Copy link
Member

@w0rp w0rp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also add gitleaks to the default list of linters for various filetypes. I think we can add it where we have a List defined for any of these filetypes. It's defined in the linter.vim file and there are tests for each of the filetypes.

@@ -0,0 +1,37 @@
Before:
call ale#assert#SetUpLinterTest('tex', 'gitleaks')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add in a test case with the supported filetypes in a List where we check if the linter is set up for all of the filetypes we need in a loop. We can write one filetype per line. Calling the tear down and set up functions in a loop will probably work.

@stale
Copy link

stale bot commented Oct 15, 2023

This pull request has been automatically marked as stale because it has not been updated recently. Make sure to write tests and document your changes. See :help ale-dev for information on writing tests.
If your pull request is good to merge, bother w0rp or another maintainer again, and get them to merge it.

@stale stale bot added the stale PRs/Issues no longer valid label Oct 15, 2023
@w0rp w0rp removed the stale PRs/Issues no longer valid label Nov 19, 2023
Copy link

stale bot commented Mar 17, 2024

This pull request has been automatically marked as stale because it has not been updated recently. Make sure to write tests and document your changes. See :help ale-dev for information on writing tests.
If your pull request is good to merge, bother w0rp or another maintainer again, and get them to merge it.

@stale stale bot added the stale PRs/Issues no longer valid label Mar 17, 2024
@stale stale bot closed this Apr 22, 2024
@w0rp w0rp reopened this Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale PRs/Issues no longer valid
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gitleaks
2 participants