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

Add lint check as requested in #20717 #21143

Closed
wants to merge 1 commit into from

Conversation

arthur801031
Copy link

@arthur801031 arthur801031 commented Nov 16, 2016

#20717

  • I'm not sure why the scss folder was not automatically downloaded when I cloned the project from the master branch, so I downloaded the scss folder manually.

Edit: Should I make this PR merge into v4-dev instead of master branch because master does not contain the scss folder?

false
end
end
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final newline missing.

# space before the end of the string
def single_space_before(string)
return false if string[-2] != ' '
return false if string[-3] == ' '

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

# Check if there is one space and only one
# space before the end of the string
def single_space_before(string)
return false if string[-2] != ' '

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

# Check if the characters before the end of the string
# are not what they should be
def chars_before_incorrect(string)
if config['style'] != 'new_line'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

else
return unless chars_before_incorrect(string)
style_message = config['style'] == 'new_line' ? 'a new line' : 'one space'
add_lint(line, 'Opening curly brace `{` should be ' \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

'`{` should be preceded by at least one space')
else
return unless chars_before_incorrect(string)
style_message = config['style'] == 'new_line' ? 'a new line' : 'one space'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Line is too long. [82/80]

if config['allow_single_line_padding'] && node_on_single_line?(node)
return unless string[-2] != ' '
add_lint(line, 'Opening curly brace in a single line rule set '\
'`{` should be preceded by at least one space')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.


if config['allow_single_line_padding'] && node_on_single_line?(node)
return unless string[-2] != ' '
add_lint(line, 'Opening curly brace in a single line rule set '\

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

line = node.source_range.end_pos.line

if config['allow_single_line_padding'] && node_on_single_line?(node)
return unless string[-2] != ' '

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

def check_for_space(node, string)
line = node.source_range.end_pos.line

if config['allow_single_line_padding'] && node_on_single_line?(node)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

alias visit_rule check_node
alias visit_while check_node

private

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent access modifiers like private.

source = source_from_range(node.source_range).strip

# Only lint `@include`s which have curly braces
if source[-1] == '{'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@@ -0,0 +1,77 @@
module SCSSLint
# Checks for the presence of a single space before an opening brace.
class Linter::VariableDefault < Linter

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use nested module/class definitions instead of compact style.

@@ -0,0 +1,77 @@
module SCSSLint

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing frozen string literal comment.

end
end
end
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final newline missing.

offsetparan = 0
offsetparan = offset_to(start_pos, '!default', offsetparan)
if offsetparan == nil
add_lint(node, 'This variable does not contain !default')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@arthur801031 arthur801031 changed the base branch from master to v4-dev November 16, 2016 07:42
@arthur801031 arthur801031 changed the base branch from v4-dev to master November 16, 2016 07:43
@Johann-S
Copy link
Member

Yes the branch for v4 is v4-dev not master. Master is for v3

@arthur801031
Copy link
Author

@Johann-S I'm going to close this PR and open another PR since the scss code that I got was not from v4-dev. Thank you!

@arthur801031 arthur801031 deleted the lint_check_default branch November 16, 2016 08:26
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 this pull request may close these issues.

3 participants