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

The glob patterns did not match any source files #31

Closed
asarkar opened this issue Nov 24, 2023 · 4 comments
Closed

The glob patterns did not match any source files #31

asarkar opened this issue Nov 24, 2023 · 4 comments

Comments

@asarkar
Copy link

asarkar commented Nov 24, 2023

Given the following directory structure:

haskell-mooc/
├── .github/
│   └── workflows/
│       └── ci.yml
├── Examples
├── Mooc
├── .stack-work
└── Set1.hs

where ci.yml runs ormolu as follows:

- name: 'Check Formatting'
  uses: haskell-actions/run-ormolu@v14
  with:
    mode: check
    pattern: |
      'Examples/*.hs'
      'Mooc/*.hs'
      '*.hs'

The build generates the following warning:

Warning: The glob patterns did not match any source files

GitHub Actions Job: https://github.com/asarkar/haskell-mooc/actions/runs/6977591684/job/18987634282#step:6:16

Ideally, it shouldn't search in hidden directories unless dotglob is set, so, it appears to be a bug. Although I'm no JS expert, I noticed what seems to be an attempt to convert relative path to absolute, and in doing so, it may be including hidden files.

@mrkkrp
Copy link
Collaborator

mrkkrp commented Nov 25, 2023

Hello, well, the code you quote is not something I wrote, it is inlined as part of packaging when index.js is converted into dist/index.js. IIUC the problem is that Set1.hs should be matched by the glob and it isn't? How is this related to hidden files? Have you tried removing single quotes around each glob? See https://github.com/haskell-actions/run-ormolu/blob/master/action.yml#L9-L11.

@asarkar
Copy link
Author

asarkar commented Nov 25, 2023

the problem is that Set1.hs should be matched by the glob

Set1 and .hs files in Examples and Mooc.

How is this related to hidden files?

Not hidden files. At some point, I thought I saw ormolu picking up files from the .stack-work directory.

tried removing single quotes

I just did, and that worked! In fact, I removed the pattern altogether, and I don't see files from the hidden .stack-work directory being included anymore.

I'm happy to close the ticket, but do you think the documentation can be updated to warn the users about not quoting the patterns?

@mrkkrp
Copy link
Collaborator

mrkkrp commented Nov 26, 2023

.stack-work should probably be gitignored.

but do you think the documentation can be updated to warn the users about not quoting the patterns?

Well, the readme already links to the example in action.yml, but maybe it is worth saying it explicitly.

@mrkkrp
Copy link
Collaborator

mrkkrp commented Nov 26, 2023

Done in 320044b.

@mrkkrp mrkkrp closed this as completed Nov 26, 2023
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