-
Notifications
You must be signed in to change notification settings - Fork 570
Add support for --source-globs-file CLI arg in relevant purs commands
#4530
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
Conversation
--source-globs CLI arg in purs compile
|
$ stack exec bash glob-test.sh
env info
0.15.14 [development build; commit: e25c476c08c2e134f5d369326060be2f0d9ef583 DIRTY]
z
├── Foo.purs
├── globsAll
├── globsNoFoo
└── src
├── Bar
│ └── Baz.purs
└── Bar.purs
2 directories, 5 files
---
module Foo where
foo = 1 :: Int
---
module Bar where
bar = 1 :: Int
---
module Bar.Baz where
baz = 1 :: Int
---
Result
z/out1
├── Bar.Baz
│ ├── externs.cbor
│ └── index.js
├── cache-db.json
├── Foo
│ ├── externs.cbor
│ └── index.js
└── package.json
2 directories, 6 files
z/out2
├── Bar
│ ├── externs.cbor
│ └── index.js
├── Bar.Baz
│ ├── externs.cbor
│ └── index.js
├── cache-db.json
├── Foo
│ ├── externs.cbor
│ └── index.js
└── package.json
3 directories, 8 files
z/out3
├── Bar
│ ├── externs.cbor
│ └── index.js
├── Bar.Baz
│ ├── externs.cbor
│ └── index.js
├── cache-db.json
├── Foo
│ ├── externs.cbor
│ └── index.js
└── package.json
3 directories, 8 files
z/out4
├── Bar
│ ├── externs.cbor
│ └── index.js
├── Bar.Baz
│ ├── externs.cbor
│ └── index.js
├── cache-db.json
├── Foo
│ ├── externs.cbor
│ └── index.js
└── package.json
3 directories, 8 files
SOURCE_GLOBS output different from EXPECTED
Expected: purs compile: No files found using pattern: z/test/**/*.purs
[1 of 2] Compiling Bar.Baz
[2 of 2] Compiling Foo
SOURCE_GLOBS: purs compile: No files found using pattern: z/test/**/*.purs
[1 of 3] Compiling Foo
[2 of 3] Compiling Bar
[3 of 3] Compiling Bar.BazI tried this script on |
|
The above issue was due to |
|
This PR is ready for an initial review now. However, I noticed an issue somewhat related to this PR with how we produce our globs. In #4480, we added the option to exclude files from the initial set of files produced by the globs. However, this change was only done in the Moreover, should the format of the glob file added here also include some code for the |
I think we should ship the feature as implemented, and we can issue a future patch if there's the need for covering more scope. I don't think the |
f-f
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The patch is good, but what about the glob-test.sh file? We should either use it from a test suite, or remove it since it will rot if not machine-checked regularly.
I've added it to our tests, but made it only run on Linux. |
I've updated this PR to also add |
|
Now that CI builds, can this get another review due to adding both |
|
Anything else? Or is this good to merge? |
rhendric
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a bunch of nits; merge once you've dealt with the ones you think are worth dealing with.
f-f
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left one nit in the changelog, but otherwise it's good to go - thanks @JordanMartinez!
|
|
||
| In the command... | ||
| ``` | ||
| purs compile inputGlob1 inputGlob2 --source-globs-file inputGlobsFoundInFile --exclude-files excludeGlob1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(github suggestions break in the presence of ```, so I'll comment line by line)
This is a bit of a nit, but I would rephrase this slightly:
| purs compile inputGlob1 inputGlob2 --source-globs-file inputGlobsFoundInFile --exclude-files excludeGlob1 | |
| purs compile inputGlob1 inputGlob2 --source-globs-file fileWithMoreGlobs --exclude-files excludeGlob1 |
| In the command... | ||
| ``` | ||
| purs compile inputGlob1 inputGlob2 --source-globs-file inputGlobsFoundInFile --exclude-files excludeGlob1 | ||
| `````` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo here?
There should be only three `
| purs compile inputGlob1 inputGlob2 --source-globs-file inputGlobsFoundInFile --exclude-files excludeGlob1 | ||
| `````` | ||
| the files passed to the compiler are: all the files found by | ||
| `inputGlob1`, `inputGlob2`, and `inputGlobsFoundinFile` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(continued from above)
| `inputGlob1`, `inputGlob2`, and `inputGlobsFoundinFile` | |
| `inputGlob1`, `inputGlob2`, and all the globs listed in `fileWithMoreGlobs`, |
Fixed! |
--source-globs CLI arg in purs compile--source-globs-file CLI arg in relevant purs commands
Description of the change
Fixes #4525.
Checklist: