Skip to content

Commit b8ac249

Browse files
jneenjneen
andauthored
Fix all trailing whitespace (#2240)
* fix all trailing whitespace * fix Layout/IndentationStyle as well * add Layout/IndentationWidth and Layout/EndAlignment * fix windows line endings * use rubocop Layout/TrailingEmptyLines --------- Co-authored-by: jneen <jneen@jneen.net>
1 parent adb0975 commit b8ac249

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+617
-706
lines changed

.rubocop.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,28 @@ Style:
2424
Layout:
2525
Enabled: false
2626

27+
Layout/TrailingWhitespace:
28+
Enabled: true
29+
AllowInHeredoc: true
30+
31+
Layout/IndentationStyle:
32+
Enabled: true
33+
IndentationWidth: 2
34+
EnforcedStyle: spaces
35+
36+
Layout/IndentationWidth:
37+
Enabled: true
38+
39+
Layout/EndAlignment:
40+
Enabled: true
41+
EnforcedStyleAlignWith: variable
42+
43+
Layout/EndOfLine:
44+
Enabled: true
45+
46+
Layout/TrailingEmptyLines:
47+
Enabled: true
48+
2749
Metrics:
2850
Enabled: false
2951

lib/rouge/cli.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def run
347347
formatter.format(lexer.lex(input)) { |piece| print piece }
348348
end
349349

350-
private_class_method def self.parse_cgi(str)
350+
private_class_method def self.parse_cgi(str)
351351
pairs = URI.decode_www_form(str).map { |k, v| [k.to_sym, v] }
352352
Hash[pairs]
353353
end
@@ -510,7 +510,7 @@ def run
510510
end
511511

512512

513-
private_class_method def self.normalize_syntax(argv)
513+
private_class_method def self.normalize_syntax(argv)
514514
out = []
515515
argv.each do |arg|
516516
case arg

lib/rouge/lexers/bicep.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Bicep < Rouge::RegexLexer
99

1010
def self.keywords
1111
@keywords ||= Set.new %w(
12-
as assert existing extends extension false for from func if import in metadata module
12+
as assert existing extends extension false for from func if import in metadata module
1313
none null output param provider resource targetScope test true type using var void with
1414
)
1515
end
@@ -76,7 +76,7 @@ def self.functions
7676
# Ignore whitespace
7777
rule %r/\s+/, Text
7878
end
79-
79+
8080
state :comments do
8181
rule %r(//[^\n\r]+), Comment::Single
8282
rule %r(/\*.*?\*/)m, Comment::Multiline

lib/rouge/lexers/cuda.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ def self.keywords_type
2424
short1 short2 short3 short4 ushort1 ushort2 ushort3 ushort4
2525
int1 int2 int3 int4 uint1 uint2 uint3 uint4
2626
long1 long2 long3 long4 ulong1 ulong2 ulong3 ulong4
27-
longlong1 longlong2 longlong3 longlong4
28-
ulonglong1 ulonglong2 ulonglong3 ulonglong4
27+
longlong1 longlong2 longlong3 longlong4
28+
ulonglong1 ulonglong2 ulonglong3 ulonglong4
2929
float1 float2 float3 float4 double1 double2 double3 double4
3030
dim3
3131
))

lib/rouge/lexers/dafny.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Dafny < RegexLexer
5858
schar = /(?:[^\\"\n\r]|\\["'ntr\\0])/
5959
uchar = /(?:\\u#{hex_digit}{4})/
6060

61-
## IMPORTANT: Rules are ordered, which allows later rules to be
61+
## IMPORTANT: Rules are ordered, which allows later rules to be
6262
## simpler than they would otherwise be
6363
state :root do
6464
rule %r(/\*), Comment::Multiline, :comment

lib/rouge/lexers/datastudio.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def self.sql_keywords
124124
rule %r/#{id}(?=\s*[(])/, Name::Function
125125
rule id do |m|
126126
name = m[0].upcase
127-
127+
128128
if self.class.sql_keywords.include? name
129129
token Keyword
130130
else

lib/rouge/lexers/glsl.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def self.keywords
4343
def self.keywords_type
4444
@keywords_type ||= Set.new %w(
4545
int void bool float double
46-
46+
4747
vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4
4848
uint uvec2 uvec3 uvec4
4949
dvec2 dvec3 dvec4

lib/rouge/lexers/go.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class Go < RegexLexer
127127
| rune | string | uint8
128128
| uint16 | uint32 | uint64
129129
| uintptr | uint
130-
)\b/x
130+
)\b/x
131131

132132
PREDECLARED_CONSTANTS = /\b(?:true|false|iota|nil)\b/
133133

lib/rouge/lexers/haxe.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def self.builtins
139139
state :root do
140140
rule %r/\n/, Text, :statement
141141
rule %r(\{), Punctuation, :expr_start
142-
142+
143143
mixin :comments_and_whitespace
144144

145145
rule %r/@/, Name::Decorator, :metadata
@@ -254,7 +254,7 @@ def self.builtins
254254
rule %r/\\x\h{2}/, Str::Escape
255255
rule %r/\\u\h{4}/, Str::Escape
256256
rule %r/\\u\{\h{1,6}\}/, Str::Escape
257-
end
257+
end
258258

259259
state :str_interpol do
260260
rule %r/\}/, Str::Interpol, :pop!

lib/rouge/lexers/idris.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def self.prelude_functions
112112

113113
rule %r/\[\s*\]/, Keyword::Type
114114
rule %r/\(\s*\)/, Name::Builtin
115-
115+
116116
# Quasiquotations
117117
rule %r/(\[)([_a-z][\w']*)(\|)/ do |m|
118118
token Operator, m[1]

0 commit comments

Comments
 (0)