-
Notifications
You must be signed in to change notification settings - Fork 128
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
Centralize Ruby Version to .ruby-version
#345
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
88d5378
Update rubocop to 1.62.1
george-ma b445a66
Centralize Ruby Version to `.ruby-version`
george-ma 7032fc0
Temporarily rename the .ruby-version file to pass CI for rubocop-old
george-ma 6af65c5
Remove ruby-version mention from linting.yml
george-ma 7d4b92f
Update rubocop-shopify
george-ma f12c57a
Disable Style/ClassMethodsDefinitions
george-ma aee9cbe
Run bundle exec rubocop -a
george-ma bc9f44f
Update better_html to 2.1.1
george-ma b1b66c4
Fix consistency typo in CI test versions
george-ma e919ba5
Resolve merge conflicts with main
george-ma File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.2.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: erb-lint | ||
|
||
up: | ||
- ruby: '3.2.2' | ||
- ruby | ||
- bundler | ||
|
||
commands: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,8 @@ class AllowedScriptType < Linter | |
include LinterRegistry | ||
|
||
class ConfigSchema < LinterConfig | ||
property :allowed_types, accepts: array_of?(String), | ||
property :allowed_types, | ||
accepts: array_of?(String), | ||
default: -> { ["text/javascript"] } | ||
property :allow_blank, accepts: [true, false], default: true, reader: :allow_blank? | ||
property :disallow_inline_scripts, accepts: [true, false], default: false, reader: :disallow_inline_scripts? | ||
|
@@ -30,8 +31,8 @@ def run(processed_source) | |
name_node = tag_node.to_a[1] | ||
add_offense( | ||
name_node.loc, | ||
"Avoid using inline `<script>` tags altogether. "\ | ||
"Instead, move javascript code into a static file." | ||
"Avoid using inline `<script>` tags altogether. " \ | ||
"Instead, move javascript code into a static file.", | ||
) | ||
next | ||
end | ||
|
@@ -44,14 +45,14 @@ def run(processed_source) | |
add_offense( | ||
name_node.loc, | ||
"Missing a `type=\"text/javascript\"` attribute to `<script>` tag.", | ||
[type_attribute] | ||
[type_attribute], | ||
) | ||
elsif type_present && [email protected]_types.include?(type_attribute.value) | ||
add_offense( | ||
type_attribute.loc, | ||
"Avoid using #{type_attribute.value.inspect} as type for `<script>` tag. "\ | ||
"Must be one of: #{@config.allowed_types.join(", ")}"\ | ||
"#{" (or no type attribute)" if @config.allow_blank?}." | ||
"Avoid using #{type_attribute.value.inspect} as type for `<script>` tag. " \ | ||
"Must be one of: #{@config.allowed_types.join(", ")}" \ | ||
"#{" (or no type attribute)" if @config.allow_blank?}.", | ||
) | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to bump Rubocop to 1.61.0 in order for this to work https://github.com/Shopify/erb-lint/blob/main/Gemfile.lock#L78