-
Notifications
You must be signed in to change notification settings - Fork 67
fix: production builds should fail when lint errors are reported #338
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
3f22b4f was necessary because of: travis-ci/travis-ci#1066 |
@zebateira I like this suggestion, but I assume we may need to go back through and lint every file consistently before merging this one. We've not each been using identical linters on our own machines during development and have taken a pretty practical approach. Some of us have likely been using backticks or double quotes to avoid escaping apostrophes in text, for example, not just for interpolation. The quotation issue will be prevalent enough for tutorial authors that if we're going to enforce consistency, we should add a note on it to the Developing Tutorials guide, keeping in mind some of our authors creating multiple-choice or text-based lessons won't be particularly familiar with JavaScript. I noticed that @olizilla's original proposals in #71 were to:
But it appears you're taking a different approach with editing vue.config.js. Since I'm not very familiar with our build tools, I'd love it if you could help me understand why you've taken a different approach and at what stage it will be flagged to the PR author (for example, will it show up as an error in the Travis build before we click to merge, even though we're not merging directly to master?) Given that this isn't my area of expertise, I'd really appreciate a review from @mikeal or @olizilla before we merge. |
@terichadbourne no worries!
Fortunately no. the linter on the travis build (and locally) runs on every file, and the only lint error reported is the one I fixed here. So all is good. Some inconsistencies will arise from the fact that there are some PRs open that do not have this new build config set, but all is good since in future PRs they will be fixed if necessary.
I see, this is a good point. I agree with adding this detail to the Developing Tutorials guide - in the cases where the authors are not well versed in Javascript, would it be feasible for us to pinch in and fix the lint issues? I mean, will they be a small number or will they be the majority?
Of course!
We could've added it to the config but
Actually the reason for this is because the webpack loader The travis build is not crashing when one of the scripts fails: travis-ci/travis-ci#1066 which is a default behavior of travis that I never had thought of 🤔to "fix" this, we can add the command
Yes, that is correct: it will show on the PR checks bellow the discussion like so: Let me know if this is clear. |
Actually, I'm now seeing that |
Thanks for the detailed explanation @zebateira!
For those building coding tutorials, we shouldn't have any trouble, but I'm hoping to play up the angle that non-coders can contribute text-based and multiple-choice lessons using our boilerplates. The concept of escaping an apostrophe is something I'd love for them to never have to learn. You can see I already have both an apostrophe in double quotes and an escaped ones in single quotes elsewhere in the mult choice boilerplate. 😂 So we should probably add notes on this in two spots: the developing a tutorial guide (maybe the troubleshooting section) and in the boilerplates themselves (as comments), at least the multiple choice one. Looks like the standard one only requires them to insert the lesson number there's not too much that should go awry there. Yes, we can always jump in right before a merge and help out ourselves (we'll need to fix the tutorial lists at that stage regardless to determine where and in what order the new submission displays), but:
While we await a review on the Travis piece from @olizilla or @mikeal, would you mind proposing edits to the boilerplates (I'd recommend checking them all for consistent formatting just in case) and the Developing tutorials guide to go along with the new linting enforcement? |
@terichadbourne I see. I think I have a proper solution for this linting issue: We can simply add a pre-commit hook that runs This should mitigate most of the issues. If someone has a hard time submitting something we can help them and revisit this issue if we find it appropriate. So I'll go ahead and work on the following if you are ok with it:
|
@zebateira I'm okay with this plan if we're positive that auto-linting won't break anything (I have an auto-lint, then auto-save thing going in one of my editors right now related to quotes that has repeatedly messed up classes and made things un-renderable by making the wrong assumptions about what quotes belong where). |
The auto-linking on the pre-commit hook will be editor independent since it will run using the projects configs always - so it will be consistent across contributors (no matter what editor they use). |
going to skip adding a pre-commit hook since it seems we already have other git hooks in place (some dependency is installing them). |
30d9459
to
0048794
Compare
@terichadbourne ready to go - I added a note in the troubleshooting section of the developing tutorials guide about linting the project. |
@zebateira Your comments highlighted the fact that we didn't have any instructions for submitting a PR, so I've reworked the guide a bit to include that. Mind proofing to see if it looks good to you? |
@terichadbourne LGTM 🙌 |
By using the option
failOnError
we can make the build fail every time we have a lint issue.Closes #71