-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 default script
to template travis.yml
#7138
Conversation
We could also update https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/script/crystal.rb#L62 to include it instead, so if we have another recommendation in the future people will automatically get upgraded to it. |
I don't think enforcing the formatter by default is a good idea. Many don't know about it or even don't like it. One thing is specs passing, if that fails it's bad, but if the formatting is wrong the program will still work fine. |
We impose a lot of opinionated stuff on users with |
Idea: what if there are two different template choices? One would be a more sparse set-up (e.g. shard.yml, minimal Travis config), and the other would add "best practices"-type stuff like this. |
There is a Moreover, not everybody will use a CI. This travis template shouldn't be in the compiler. |
I even think that the There is a shards specific template file, https://github.com/crystal-lang/crystal/blob/master/src/compiler/crystal/tools/init/template/shard.yml.ecr Even though shards is for now the defacto package manager, the crystal compiler should be agnostic. To sum up:
|
@j8r Agreed - Rust does |
I think we could include these changes but commented with a note to the user. Uncomment if you want to run formatter on the CI together with the specs. I think that is an improvement, gives awareness of the formatter tool functionality to the users that want will want to use travis because the configuration is already there. |
As for the discussion of minimality, no scaffolding will satisfy everybody. I think @paulcsmith liked the idea of a cli that will be able to expand/generate scaffolding based on options. like yeoman. Having CI options there will probably be a good thing to have. But I prefer to encourage at least some CI with no effort by the end user. |
Generator options would be cool, but maybe not worth the time and effort as the language is still young. In the meantime you may want to leave a comment so people can discover how to check formatting in CI easily. Here's what we do for a new Lucky project: script:
- crystal spec
# Uncomment the next line if you'd like Travis to check code formatting
# - crystal tool format spec src --check This way it is off by default but it is easy to add and discover when you want it. I remember having to poke around quite a bit to figure this out the first time through |
Adding a |
We could probably make |
This is what we did for lucky init recently and it’s worked really well. People know the options available and can pick and choose what they want
luckyframework/lucky_cli#221
It’s reduced a lot of questions around how/if lucky supports api only. I imagine something similar could be done for Crystal init
… On Dec 19, 2018, at 4:47 PM, Ary Borenszweig ***@***.***> wrote:
We could probably make crystal init ask these questions to the user with some opinionated defaults. That would also simplify it's interface, right now I find it a bit confusing that you have to pass crystal init lib|app name, I always do crystal init name and get an error. With a redesigned interface it will just be crystal init and then the program will start asking questions (name? app or lib? which CI, if any? want to check format in CI? etc.)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Good idea, but please if someone plans to work on this, consider integrating outside the compiler. (e.g. Again, the compiler job is to deal with source code, only; not providing shiny opinionated projet management abilities. |
Let's just alter this PR to leave it commented |
OK, looks like an acceptable path forward was established, so I just commented out the controversial lines to strike a balance between encouraging and enforcing usage of the compiler's |
This needs a rebase? What's wrong with CI? |
@KCErb a rebase and this should be good to 🚢 |
8066532
to
dabaafa
Compare
@sdogruyol I rebased locally and pushed (by force ... not sure which step I muffed to need that) back up so I believe this is in a good place now. We'll see how the tests do. |
After a rebase, you always need to force push because the commits are now based on a different parent. |
@straight-shoota thanks for confirming, that's how it looked to me but I'm sure I have a lot left to learn about |
Based on some discussion here: crystal-lang/crystal-book#299 (comment)
Our docs recommend that folks add these lines to their
travis.yml
but it seems reasonable that the template could be shipped with them by default.