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

Presence of .scss file in a plugin makes moodle-plugin-ci grunt command to fail #314

Open
marinaglancy opened this issue Aug 27, 2024 · 3 comments · May be fixed by #320
Open

Presence of .scss file in a plugin makes moodle-plugin-ci grunt command to fail #314

marinaglancy opened this issue Aug 27, 2024 · 3 comments · May be fixed by #320

Comments

@marinaglancy
Copy link
Member

marinaglancy commented Aug 27, 2024

We have a plugin that has a .scss file that we just store there together with a script that compiles to .css

On moodle-plugin-ci 4.5.4 the 'grunt' command fails:

Run moodle-plugin-ci grunt --max-lint-warnings 0
 RUN  Grunt on block_rbreport
Running "gherkinlint" task
Done.
>> Running tasks for component directory blocks/rbreport
Running "stylelint:css" (stylelint) task
>> Linted 1 files without errors
Done.
>> Running tasks for component directory blocks/rbreport
Running "stylelint:scss" (stylelint) task
Verifying property stylelint.scss exists in config...ERROR
>> Unable to process task.
Warning: Required config property "stylelint.scss" missing.� Use --force to continue.
Aborted due to warnings.
Error: Process completed with exit code 1.

This was not failing on moodle-plugin-ci 4.5.0

@marinaglancy
Copy link
Member Author

marinaglancy commented Aug 27, 2024

This is the plugin itself: https://github.com/moodleworkplace/moodle-block_rbreport

For now we are adding a workaround - the file .moodle-plugin-ci.yml with the contents:

filter:
  notPaths:
    - scss

@kabalin
Copy link
Member

kabalin commented Aug 27, 2024

Hm, this is likely caused by #278 (included in 4.5.1)

@kabalin
Copy link
Member

kabalin commented Sep 10, 2024

The fundamental issue is that we do not expect scss/ directory to present in non-theme plugins when calling grunt stylelint:scss, so it is not added to gruntfile config.

This issue can be replicated by calling stylelint:scss on block_rbreport repo, you will get the same error:

1055 rbreport:MOODLE_402_STABLE> npx grunt stylelint:scss
>> Running tasks for component directory blocks/rbreport

Running "stylelint:scss" (stylelint) task
Verifying property stylelint.scss exists in config...ERROR
>> Unable to process task.
Warning: Required config property "stylelint.scss" missing. Use --force to continue.

Aborted due to warnings.

The solution is not to use explicit stylelint:scss in grunt command, instead call stylelint and let grunt task logic to decide type of stylelint to run. We still need support for cases when someone pass --task stylelint:scss though, it would make sense to check that we are dealing with theme plugin, or just pass to Moodle core grunt task to decide.

Patch will follow.

kabalin added a commit to kabalin/moodle-plugin-ci that referenced this issue Sep 10, 2024
So that core grunt task will decide whether css or scss linter needs to be run (or both).

Fixes moodlehq#314
@kabalin kabalin linked a pull request Sep 10, 2024 that will close this issue
kabalin added a commit to kabalin/moodle-plugin-ci that referenced this issue Sep 13, 2024
So that core grunt task will decide whether css or scss linter needs to be run (or both).

Fixes moodlehq#314
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

Successfully merging a pull request may close this issue.

2 participants