earlybird icon indicating copy to clipboard operation
earlybird copied to clipboard

ignore files issue

Open juju4 opened this issue 2 years ago • 1 comments

I'm testing earlybird against an ansible role repository, normally an easy one. I still get many false-positive matches that I'm trying to ignore zith ~/.ge_ignore but it seems the pattern style is not working or a format that I'm not expecting. Tried with filename, shell wildcard pattern. also double wildcard like https://github.com/aschaef19/earlybird/blob/main/.ge_ignore

$ go-earlybird -path=. -verbose
022/04/30 10:08:10 Go-EarlyBird version:  2.0.0
Severity Fail threshold (at or above):  low
Confidence Fail threshold (at or above):  low
Severity Display threshold (at or above):  low
Confidence Display threshold (at or above):  low
Max file size to scan:  10240000  bytes
2022/04/30 10:08:10 loading module:  ccnumber
2022/04/30 10:08:10 loading module:  content
2022/04/30 10:08:10 loading module:  filename
2022/04/30 10:08:10 loading module:  inclusivity-rules
2022/04/30 10:08:10 loading module:  password-secret
2022/04/30 10:08:10 Scanning directory:  .
2022/04/30 10:08:10 Ignore pattern:  *.git/*, .vagrant/, *.retry, .kitchen, inspec.lock, [._]*.s[a-v][a-z], [._]*.sw[a-p], [._]s[a-v][a-z], [._]sw[a-p], Session.vim, Sessionx.vim, .netrwhist, *~, tags, [._]*.un~, __pycache__/, *.py[cod], *$py.class, *.so, .Python, build/, develop-eggs/, dist/, downloads/, eggs/, .eggs/, lib/, lib64/, parts/, sdist/, var/, wheels/, *.egg-info/, .installed.cfg, *.egg, MANIFEST, *.manifest, *.spec, pip-log.txt, pip-delete-this-directory.txt, htmlcov/, .tox/, .coverage, .coverage.*, .cache, nosetests.xml, coverage.xml, *.cover, .hypothesis/, *.mo, *.pot, *.log, .static_storage/, .media/, local_settings.py, instance/, .webassets-cache, .scrapy, docs/_build/, target/, .ipynb_checkpoints, .python-version, celerybeat-schedule, *.sage.py, .env, .venv, env/, venv/, ENV/, env.bak/, venv.bak/, .spyderproject, .spyproject, .ropeproject, /site, .mypy_cache/, .DS_Store, .AppleDouble, .LSOverride, Icon, ._*, .DocumentRevisions-V100, .fseventsd, .Spotlight-V100, .TemporaryItems, .Trashes, .VolumeIcon.icns, .com.apple.timemachine.donotpresent, .AppleDB, .AppleDesktop, Network Trash Folder, Temporary Items, .apdisk, *~, .fuse_hidden*, .directory, .Trash-*, .nfs*, Thumbs.db, ehthumbs.db, ehthumbs_vista.db, *.stackdump, [Dd]esktop.ini, $RECYCLE.BIN/, *.cab, *.msi, *.msm, *.msp, *.lnk, secring.*, *.ca, *.crt, *.csr, *.der, *.kdb, *.org, *.p12, *.pem, *.rnd, *.ssleay, *.smime, **/.git, **/.gitignore, **/.github/workflows/galaxy.yml, **/.secrets.baseline, **/.pre-commit-config.yaml, **/test/earlybird/falsepositives-ansible.yaml, .git, .gitignore, .github/workflows/galaxy.yml, galaxy.yml, .secrets.baseline, .pre-commit-config.yaml, test/earlybird/falsepositives-ansible.yaml, falsepositives-ansible.yaml, */.git, */.gitignore, /.git, /.gitignore, */.git*, */.gitignore*, ./.git, ./.gitignore
2022/04/30 10:08:10 Reading file  .ansible-lint
2022/04/30 10:08:10 Reading file  .codespellignore
2022/04/30 10:08:10 Reading file  .git
2022/04/30 10:08:10 Reading file  .github/stale.yml
2022/04/30 10:08:10 Reading file  .github/workflows/codespell.yml
2022/04/30 10:08:10 Reading file  .github/workflows/default.yml
2022/04/30 10:08:10 Reading file  .github/workflows/dryrun-bare.yml
2022/04/30 10:08:10 Reading file  .github/workflows/earlybird.yml
2022/04/30 10:08:10 Reading file  .github/workflows/galaxy.yml
2022/04/30 10:08:10 Reading file  .github/workflows/lint.yml
2022/04/30 10:08:10 Reading file  .gitignore
[...]

from my reading of code, "Reading file " should not appear if file is correctly ignored https://github.com/americanexpress/earlybird/blob/main/pkg/file/fileUtil.go#L196 match seems custom character per character as per https://github.com/americanexpress/earlybird/blob/main/pkg/wildcard/patternMatch.go

Note that even if it says " Go-EarlyBird version: 2.0.0", this is from latest download aka https://github.com/americanexpress/earlybird/releases/download/v3.12.0/go-earlybird-linux

Example run in https://github.com/juju4/ansible-adduser/runs/6142207431?check_suite_focus=true#step:6:1

Thanks for sharing your work

juju4 avatar Apr 30 '22 14:04 juju4

I can replicate this issue and am having the same problem.

Cr0n1c avatar Jun 06 '22 14:06 Cr0n1c