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

.secretlintignore does not work in Windows #589

Closed
risu729 opened this issue Aug 5, 2023 · 8 comments · Fixed by #590
Closed

.secretlintignore does not work in Windows #589

risu729 opened this issue Aug 5, 2023 · 8 comments · Fixed by #590
Labels
Type: Bug Bug or Bug fixes

Comments

@risu729
Copy link
Contributor

risu729 commented Aug 5, 2023

What version of secretlint are you using?

7.0.3

What did you do? Please include the actual steps causing the issue.

  1. Write a secret in test.txt
  2. Add it to .secretlintignore
test.txt
  1. Run pnpm secretlint "**/*" --maskSecrets

What did you expect to happen?
No errors were thrown.

What actually happened? Please include the actual, raw output from secretlint.

test.txt has not been ignored.

  secretlint input: [ '**/*' ] +0ms
  secretlint flags: {
  secretlint   maskSecrets: true,
  secretlint   init: false,
  secretlint   format: 'stylish',
  secretlint   secretlintignore: '.secretlintignore',
  secretlint   color: true,
  secretlint   terminalLink: true,
  secretlint   profile: false,
  secretlint   cwd: 'C:\\Users\\taku\\Documents\\GitHub\\reponame',
  secretlint   debug: false
  secretlint } +5ms
  secretlint searchFiles ignore baseDir: , normalizeIgnoreFilePath: C:\Users\taku\Documents\GitHub\reponame\.secretlintignore +0ms
  secretlint ignored: [ '/Users/taku/Documents/GitHub/reponame/test.txt' ] +2ms
  secretlint search patterns: [ '**/*' ] +1ms
  secretlint search ignore patterns: [ '**/.git/**', '**/node_modules/**', '**/.secretlintrc/**', '**/.secretlintrc.{json,yaml,yml,js}/**', '**/.secretlintignore*/**', '/Users/taku/Documents/GitHub/reponame/test.txt' ] +0ms

C:/Users/taku/Documents/GitHub/reponame/test.txt
  1:0  error  [GITHUB_TOKEN] found GitHub Token(*****************************): ****************************************  @secretlint/secretlint-rule-preset-recommend > @secretlint/secretlint-rule-github

✖ 1 problem (1 error, 0 warnings)

I will create a PR to fix this issue soon.

@azu azu added Type: Bug Bug or Bug fixes Status: Need More Info Lacks enough info to make progress labels Aug 5, 2023
@azu
Copy link
Member

azu commented Aug 5, 2023

Can you paste your .secretlintignore?

@risu729
Copy link
Contributor Author

risu729 commented Aug 5, 2023

Updated the original comment!

@azu
Copy link
Member

azu commented Aug 5, 2023

Thanks.

Probably, current implement has an issue on Windows, I think.

export const searchFiles = async (patterns: string[], options: SearchFilesOptions) => {

However, globby has supported ignoreFiles option at recent.
Switing current implemention to ignoreFiles option that may resolve this issue.

@azu azu removed the Status: Need More Info Lacks enough info to make progress label Aug 5, 2023
@azu
Copy link
Member

azu commented Aug 5, 2023

Remove ignore option for isGitIgnored and isGitIgnoredSync (sindresorhus/globby#225) sindresorhus/globby@2e43cc4
This option never worked correctly.
Release v13.0.0 · sindresorhus/globby

current implementation uses ignore option. We need to update globby and use ignoreFiles.

TODO

@risu729
Copy link
Contributor Author

risu729 commented Aug 5, 2023

Thank you for your information. It seems better than my solution!
Can I close my PR?

@azu
Copy link
Member

azu commented Aug 5, 2023

@risu729 Thanks for PR!
No problem. I will merge your PR soon.

I'll file my suggestion as another issue.

@azu
Copy link
Member

azu commented Aug 5, 2023

This will be fixed in v7.0.4

Thanks for PR!

@azu
Copy link
Member

azu commented Aug 6, 2023

I created a separate Issue for the remaining tasks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Bug or Bug fixes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants