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

[Linter::Haml] Avoid haml-lint STDERR warnings #549

Merged
merged 1 commit into from
Mar 4, 2021

Conversation

NickLaMuro
Copy link
Member

Injects a "stub" 'parser/current' file (that should be appended to the Ruby $LOADPATH), which avoids the annoying loading the original, which includes the unskippable warnings like this:

warning: parser/current is loading parser/ruby27, which recognizes
warning: 2.7.2-compliant syntax, but you are running 2.7.1.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.

in STDERR, which are flagged by the bot as errors (when they aren't useful to the end user).

This stub will just define the Parser::CurrentRuby constant manually using the conventions of the parser gem.

Example in the wild

ManageIQ/manageiq-ui-classic#7650 (comment)

(copied in case that goes away)

Checked commit
NickLaMuro/manageiq-ui-classic@386138b
with ruby 2.6.3, rubocop 0.82.0, haml-lint 0.35.0, and yamllint 3 files
checked, 1 offense detected

**

  • 💣 💥 🔥 🚒 - Linter/Haml - Linter::Haml STDERR:
warning: parser/current is loading parser/ruby26, which recognizes
warning: 2.6.6-compliant syntax, but you are running 2.6.3.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.

Injects a "stub" 'parser/current' file (that should be appended to the Ruby
$LOADPATH), which avoids the annoying loading the original, which includes
the unskippable warnings like this:

    warning: parser/current is loading parser/ruby27, which recognizes
    warning: 2.7.2-compliant syntax, but you are running 2.7.1.
    warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.

in STDERR, which are flagged by the bot as errors (when they aren't useful to
the end user).

This stub will just define the `Parser::CurrentRuby` constant manually using
the conventions of the `parser` gem.
@miq-bot
Copy link
Member

miq-bot commented Mar 2, 2021

Checked commit NickLaMuro@186680b with ruby 2.6.3, rubocop 0.82.0, haml-lint 0.35.0, and yamllint
3 files checked, 2 offenses detected

lib/linter/haml.rb

  • ❗ - Line 14, Col 26 - Rails/FilePath - Please use Rails.root.join('path/to') instead.

vendor/stubs/parser/current.rb

@Fryguy Fryguy merged commit 38a76c6 into ManageIQ:master Mar 4, 2021
@Fryguy Fryguy self-assigned this Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants