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

Add check that file was not added #11

Open
ai opened this issue Jul 10, 2024 · 5 comments
Open

Add check that file was not added #11

ai opened this issue Jul 10, 2024 · 5 comments

Comments

@ai
Copy link

ai commented Jul 10, 2024

Use case:

I want to add “Add tests” message if user change core/*.ts but don’t change anything in core/test/*.test.ts

So I suggest something like:

    - paths: 'core/*.ts'
      missed: 'core/test/*.test.ts'
      message: |
        - [ ] Don’t rush. Check all changes in PR again.
        - [ ] Run `pnpm test`.
@pshergie
Copy link
Owner

Good idea, the only thing I'd change is to rename missed to exclude

@ai
Copy link
Author

ai commented Jul 12, 2024

exclude for me looks like list to exclude from paths, like !pattern in glob

@pshergie
Copy link
Owner

so, wouldn't the - paths: 'core/*.ts', !core/test/*.test.ts pattern work in your case? Would you prefer an explicit config setting to it?

@ai
Copy link
Author

ai commented Jul 12, 2024

No, ! only affect to the glob matching pattern, no to the list:

glob({
  pattern: ['a*.txt', '!ab.txt'],
  files: ['a.txt', 'ab.txt']
}) //=> true, since `a.txt` still pass ['a*.txt', '!ab.txt'] pattern

@pshergie
Copy link
Owner

I see. Still, I think "skip" or "ignore" would suit better than "missed"

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

No branches or pull requests

2 participants