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

Added Filter as a new JSON field for custom rules #120

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ne0z
Copy link

@ne0z ne0z commented Jun 23, 2022

Signed-off-by: Danang Heriyadi danang.heriyadi19@gmail.com

- What I did
Add filter file feature to horusec-engine. This PR is related to this issue ZupIT/horusec#1077

- How to verify it

- Description for the changelog

Signed-off-by: Danang Heriyadi <danang.heriyadi19@gmail.com>
@wiliansilvazup
Copy link
Contributor

@ne0z tnks for contribution

I added some comments into the issue opened check for update this PR.

And after add tests you can run command: "make format" and "make lint" to fix problems reported in pipeline :)

Signed-off-by: Danang Heriyadi <danang.heriyadi19@gmail.com>
@ne0z
Copy link
Author

ne0z commented Jul 10, 2022

@wiliansilvazup thanks for the advice, I have fixed the linter. Tested on apple M1 shows as below :

$ make lint       
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
golangci-lint run -v --timeout=5m -c .golangci.yml ./...
INFO [config_reader] Used config file .golangci.yml 
INFO [lintersdb] Active 45 linters: [bodyclose deadcode depguard dogsled dupl errcheck errorlint exhaustive exportloopref funlen gci gochecknoinits gocognit goconst gocritic gocyclo gofmt gofumpt goimports gomnd goprintffuncname gosec gosimple govet ineffassign lll misspell nakedret nestif nlreturn noctx nolintlint revive rowserrcheck staticcheck structcheck stylecheck testpackage typecheck unconvert unparam unused varcheck whitespace wsl] 
INFO [loader] Go packages loading at mode 575 (imports|name|types_sizes|compiled_files|deps|exports_file|files) took 130.183833ms 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 652.042µs 
WARN [linters context] gci: `local-prefixes` is deprecated, use `sections` and `prefix(github.com/ZupIT/horusec-engine)` instead. 
INFO [linters context/goanalysis] analyzers took 0s with no stages 
INFO [runner/skip dirs] Skipped 4 issues from dir text/examples/go/example2 by pattern examples/ 
INFO [runner] Issues before processing: 37, after processing: 0 
INFO [runner] Processors filtering stat (out/in): nolint: 0/12, exclude-rules: 12/25, path_prettifier: 37/37, skip_files: 29/37, skip_dirs: 25/29, exclude: 25/25, autogenerated_exclude: 25/25, cgo: 37/37, filename_unadjuster: 37/37, identifier_marker: 25/25 
INFO [runner] processing took 1.896631ms with stages: exclude-rules: 625.584µs, nolint: 575.042µs, identifier_marker: 353.292µs, autogenerated_exclude: 141.375µs, path_prettifier: 124.667µs, skip_files: 49.167µs, skip_dirs: 19.917µs, cgo: 3.958µs, filename_unadjuster: 1.542µs, max_same_issues: 458ns, severity-rules: 251ns, uniq_by_line: 250ns, max_from_linter: 250ns, source_code: 209ns, exclude: 209ns, max_per_file_from_linter: 167ns, path_shortener: 84ns, diff: 84ns, path_prefixer: 84ns, sort_results: 41ns 
INFO [runner] linters took 31.033208ms with stages: goanalysis_metalinter: 29.102375ms 
INFO File cache stats: 0 entries of total size 0B 
INFO Memory: 3 samples, avg is 54.1MB, max is 72.8MB 
INFO Execution took 168.337042ms 

ne0z added 2 commits July 11, 2022 01:40
…ruct

Signed-off-by: Danang Heriyadi <danang.heriyadi19@gmail.com>
Signed-off-by: Danang Heriyadi <danang.heriyadi19@gmail.com>
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