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

Suggested build command for use with tests #53

Closed
paulyoung opened this issue Mar 3, 2016 · 16 comments
Closed

Suggested build command for use with tests #53

paulyoung opened this issue Mar 3, 2016 · 16 comments

Comments

@paulyoung
Copy link

I've been using pulp build --src-path test --include src as my build command since files in the test directory were otherwise not providing error or linter information.

@nwolverson
Copy link
Owner

What's your workflow, how do you think this should manifest in the atom package? ie I assume you want to see if your changes have stopped your tests building (on save?), thinking also things have to work for projects with no test folder. Or is this a documentation suggestion?

@paulyoung
Copy link
Author

I have a project with src/ and test/ directories and noticed that I wasn't seeing warnings about problems in my test files.

It was a documentation suggestion since not all projects have a test/ directory and everything stops working when using this command in that case.

Since there's no ability to have per-project settings (that I know of) it would be great to have it "just work" either way.

I tried if [ -d ./test ]; then pulp build --src-path test --include src; else pulp build; fi but that causes an error in Atom.

@nwolverson
Copy link
Owner

I'll think to add a configuration tips section at least. You could write yourself a script that does that and invoke that?

@paulyoung
Copy link
Author

Yeah, good idea.

@paulyoung
Copy link
Author

Just wanted to add that it's now necessary to also pass --json-errors.

@paulyoung
Copy link
Author

Also, @hdgarrood pointed out that pulp build --include test would work, so now I'm using pulp build --include test --json-errors.

@paulyoung
Copy link
Author

Another update – after some discussion in purescript-contrib/pulp#192, I have npm run build set up like so:

{
  "scripts": {
    "build": "pulp build --include test"
  }
}

and I've set my build command for atom-ide-purescript to:

npm run build -- --json-errors

This way:

  • each project can set npm run build to include zero or more relevant directories.
  • errors are only output in JSON format when invoked from Atom.

@nwolverson
Copy link
Owner

I've updated the README to include some more detailed notes on build configuration and the above tip, does this make sense?

@hdgarrood
Copy link

Looks good but I think your example of using psc directly will miss FFI files.

@nwolverson
Copy link
Owner

Did I dream that those are automagially picked up now? Is it that you don't need to explicitly say --ffi but you still need to pass in the glob?

@hdgarrood
Copy link

Yes, I think that's it.

@nwolverson
Copy link
Owner

Updated that, apparently .{purs,js} works nicely. Thanks for the spot.

@hdgarrood
Copy link

I think that might be your shell, unfortunately. The Haskell package Glob doesn't recognise that kind of pattern:

$ psc 'src/**/*.{purs,js}' 'bower_components/purescript-*/src/**/*.{purs,js}'
psc: No files found using pattern: src/**/*.{purs,js}
psc: No files found using pattern: bower_components/purescript-*/src/**/*.{purs,js}
psc: No input files.

@hdgarrood
Copy link

We could use src/**/* after purescript/purescript#1937 is fixed, though.

@nwolverson
Copy link
Owner

@hdgarrood Dammit, I assumed it wasn't my shell because I tested on windows, apparently that was under bash, I'll update to the simple thing for now. I guess *.* should also work though.

@paulyoung
Copy link
Author

Thanks!

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

3 participants