Skip to content

ignore files issue #43

@juju4

Description

@juju4

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions