open-lms-open-source / moodle-plugin-ci

Assist with running a Moodle plugin in Travis CI
https://blackboard-open-source.github.io/moodle-plugin-ci/
GNU General Public License v3.0
43 stars 37 forks source link

grunt: stylelint task running even when not specified #72

Closed junpataleta closed 6 years ago

junpataleta commented 6 years ago

Hello there. Thanks for this really helpful tool!

So I have this Gruntfile.js, where I only registered "eslint:amd" and "uglify" tasks to run. When I execute grunt locally, it works okay.

However, when the task is being run in Travis by the moodle-plugin-ci, I can see that the stylelint task is still being executed, which then results in a failed build:

Running "stylelint:css" (stylelint) task Warning: Running stylelint failed Error: node_modules/mute-stream/coverage/lcov-report/base.css, node_modules/mute-stream/coverage/lcov-report/prettify.css and node_modules/tiny-lr/examples/express/styles/site.css do not match any files at globby.then.filePaths (/home/travis/build/moodle/node_modules/grunt-stylelint/node_modules/stylelint/lib/standalone.js:124:33) at :null:null  Use --force to continue. Aborted due to warnings.

Not sure if it is an issue with the moodle-plugin-ci, or if I'm missing something.

Thanks!

polothy commented 6 years ago

From https://moodlerooms.github.io/moodle-plugin-ci/TravisFileExplained.html

# This step runs Grunt tasks on the plugin.  By default, it tries to run
# tasks relevant to your plugin and Moodle version, but you can run
# specific tasks by passing them as options,
# EG: moodle-plugin-ci grunt -t task1 -t task2 
  - moodle-plugin-ci grunt

So, try this out (or some variation of it):

  - moodle-plugin-ci grunt -t eslint:amd -t uglify

Hope that helps, cheers!

junpataleta commented 6 years ago

Aha! Thanks, that worked!

I was kind of expecting for the moodle-plugin-ci grunt task to only run the tasks defined in Gruntfile.js, but all good. Please feel free to close this ticket.

Thanks again!

polothy commented 6 years ago

Yeah, due to being able to define whatever you want in Grunt, it makes it hard to discover available tasks and there isn't always a default option that works well. Glad it worked for you, cheers!