Skip to content

Commit 15abbd2

Browse files
committed
Fix guard warnings
1 parent f846d98 commit 15abbd2

File tree

5 files changed

+109
-92
lines changed

5 files changed

+109
-92
lines changed

.prettierrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"overrides": [
3+
{
4+
"files": ["*.scss", "*.css"],
5+
"options": {
6+
"tabWidth": 4
7+
}
8+
}
9+
]
10+
}

app/assets/stylesheets/home.scss

+94-87
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,35 @@
66
@import "normalize-rails/normalize";
77

88
body {
9-
font-family: "Open Sans", sans-serif;
10-
margin: 0;
11-
font-size: $base-font-size;
12-
line-height: $base-line-height;
13-
background-color: $bg-color; // For "infinite" footer
9+
font-family: "Open Sans", sans-serif;
10+
margin: 0;
11+
font-size: $base-font-size;
12+
line-height: $base-line-height;
13+
background-color: $bg-color; // For "infinite" footer
1414
}
1515

1616
// FIXME
1717
// scss-lint:disable ColorVariable
1818

1919
a {
20-
color: rgb(78, 94, 255);
21-
text-decoration: none;
20+
color: rgb(78, 94, 255);
21+
text-decoration: none;
2222

23-
&:hover {
24-
text-decoration: underline;
25-
}
23+
&:hover {
24+
text-decoration: underline;
25+
}
2626

27-
&.stealth-link {
28-
color: inherit;
29-
}
27+
&.stealth-link {
28+
color: inherit;
29+
}
3030
}
3131

3232
p {
33-
margin: 12px 0;
33+
margin: 12px 0;
3434

35-
&.choose-party {
36-
font-size: 34px;
37-
}
35+
&.choose-party {
36+
font-size: 34px;
37+
}
3838
}
3939

4040
h1,
@@ -44,144 +44,151 @@ h4,
4444
h5,
4545
h6,
4646
p {
47-
&:first-child {
48-
margin-top: 0;
49-
}
47+
&:first-child {
48+
margin-top: 0;
49+
}
5050
}
5151

5252
select {
53-
border-radius: 5px;
54-
font-size: 0.9em;
55-
background-color: white;
53+
border-radius: 5px;
54+
font-size: 0.9em;
55+
background-color: white;
5656
}
5757

5858
.container {
59-
max-width: 960px;
60-
padding: 16px;
61-
margin: auto;
62-
63-
@include smallscreen {
59+
max-width: 960px;
6460
padding: 16px;
65-
}
61+
margin: auto;
62+
63+
@include smallscreen {
64+
padding: 16px;
65+
}
6666
}
6767

6868
.container-narrow {
69-
max-width: 600px;
69+
max-width: 600px;
7070
}
7171

7272
.container-extra-narrow {
73-
max-width: 450px;
73+
max-width: 450px;
7474
}
7575

7676
.background-pattern {
77-
background-color: #e4e4e4;
78-
background-image: image-url("pattern.png");
77+
background-color: #e4e4e4;
78+
background-image: image-url("pattern.png");
7979
}
8080

8181
.plain-pattern {
82-
background-color: white;
82+
background-color: white;
8383
}
8484

8585
.border-bottom {
86-
border-bottom: 1px solid $border-color;
86+
border-bottom: 1px solid $border-color;
8787
}
8888

8989
.text-center {
90-
text-align: center;
90+
text-align: center;
9191
}
9292

9393
.text-error {
94-
color: red;
94+
color: red;
9595
}
9696

9797
.text-warning {
98-
color: orange;
98+
color: orange;
9999
}
100100

101101
.text-success {
102-
color: rgb(56, 182, 4);
102+
color: rgb(56, 182, 4);
103103
}
104104

105105
.small {
106-
font-size: $base-font-size * 0.8;
106+
font-size: $base-font-size * 0.8;
107107
}
108108

109109
.subdued {
110-
color: #999;
110+
color: #999;
111111
}
112112

113113
.spacer {
114-
height: 12px;
114+
height: 12px;
115115
}
116116

117117
.smv-card {
118-
border-radius: 6px;
119-
border: 1px solid darken($border-color, 10%);
120-
padding: 12px;
121-
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
122-
margin-bottom: 16px;
123-
background-color: white;
118+
border-radius: 6px;
119+
border: 1px solid darken($border-color, 10%);
120+
padding: 12px;
121+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
122+
margin-bottom: 16px;
123+
background-color: white;
124124

125-
> h1,
126-
h2,
127-
h3 {
128-
margin-top: 0;
129-
}
125+
> h1,
126+
h2,
127+
h3 {
128+
margin-top: 0;
129+
}
130130
}
131131

132132
.searching-for-swap {
133-
position: relative;
133+
position: relative;
134134

135-
i {
136-
// scss-lint:disable VendorPrefix
137-
margin-right: 6px;
138-
color: #aaa;
139-
}
135+
i {
136+
// scss-lint:disable VendorPrefix
137+
margin-right: 6px;
138+
color: #aaa;
139+
}
140140

141-
span {
142-
display: inline-block;
143-
}
141+
span {
142+
display: inline-block;
143+
}
144144
}
145145

146146
$oscillation-size: 3px;
147147

148148
// scss-lint:disable SpaceBeforeBrace
149149
// scss-lint:disable VendorPrefix
150150
@-webkit-keyframes oscillate {
151-
from {
152-
-webkit-transform: rotate(0deg) translateX($oscillation-size) rotate(0deg);
153-
}
154-
to {
155-
-webkit-transform: rotate(360deg) translateX($oscillation-size)
156-
rotate(-360deg);
157-
}
151+
from {
152+
-webkit-transform: rotate(0deg) translateX($oscillation-size)
153+
rotate(0deg);
154+
}
155+
156+
to {
157+
-webkit-transform: rotate(360deg) translateX($oscillation-size)
158+
rotate(-360deg);
159+
}
158160
}
159161

160162
@-moz-keyframes oscillate {
161-
from {
162-
-moz-transform: rotate(0deg) translateX($oscillation-size) rotate(0deg);
163-
}
164-
to {
165-
-moz-transform: rotate(360deg) translateX($oscillation-size) rotate(-360deg);
166-
}
163+
from {
164+
-moz-transform: rotate(0deg) translateX($oscillation-size) rotate(0deg);
165+
}
166+
167+
to {
168+
-moz-transform: rotate(360deg) translateX($oscillation-size)
169+
rotate(-360deg);
170+
}
167171
}
168172

169173
@-o-keyframes oscillate {
170-
from {
171-
-o-transform: rotate(0deg) translateX($oscillation-size) rotate(0deg);
172-
}
173-
to {
174-
-o-transform: rotate(360deg) translateX($oscillation-size) rotate(-360deg);
175-
}
174+
from {
175+
-o-transform: rotate(0deg) translateX($oscillation-size) rotate(0deg);
176+
}
177+
178+
to {
179+
-o-transform: rotate(360deg) translateX($oscillation-size)
180+
rotate(-360deg);
181+
}
176182
}
177183

178184
@keyframes oscillate {
179-
from {
180-
transform: rotate(0deg) translateX($oscillation-size) rotate(0deg);
181-
}
182-
to {
183-
transform: rotate(360deg) translateX($oscillation-size) rotate(-360deg);
184-
}
185+
from {
186+
transform: rotate(0deg) translateX($oscillation-size) rotate(0deg);
187+
}
188+
189+
to {
190+
transform: rotate(360deg) translateX($oscillation-size) rotate(-360deg);
191+
}
185192
}
186193
// scss-lint:enable VendorPrefix
187194
// scss-lint:enable SpaceBeforeBrace

spec/controllers/user/constituencies_controller_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
before do
1515
# Stub out authentication
16-
allow(request.env['warden']).to receive(:authenticate!).and_return(logged_in_user)
16+
allow(request.env["warden"]).to receive(:authenticate!).and_return(logged_in_user)
1717
allow(controller).to receive(:current_user).and_return(logged_in_user)
1818

1919
allow(User).to receive(:find_by_id).with(:some_user_id).and_return(logged_in_user)

spec/controllers/user/swaps_controller_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
before do
2626
# Stub out authentication
27-
allow(request.env['warden']).to receive(:authenticate!).and_return(new_user)
27+
allow(request.env["warden"]).to receive(:authenticate!).and_return(new_user)
2828
allow(controller).to receive(:current_user).and_return(new_user)
2929

3030
allow(User).to receive(:find).with(swap_user.id.to_s)
@@ -86,7 +86,7 @@
8686

8787
before do
8888
# Stub out authentication
89-
allow(request.env['warden']).to receive(:authenticate!).and_return(new_user)
89+
allow(request.env["warden"]).to receive(:authenticate!).and_return(new_user)
9090
allow(controller).to receive(:current_user).and_return(new_user)
9191

9292
allow(User).to receive(:find).with(swap_user.id.to_s)

spec/controllers/users_controller_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
before do
1212
# Stub out authentication
13-
allow(request.env['warden']).to receive(:authenticate!).and_return(logged_in_user)
13+
allow(request.env["warden"]).to receive(:authenticate!).and_return(logged_in_user)
1414
allow(controller).to receive(:current_user).and_return(logged_in_user)
1515
end
1616

@@ -80,7 +80,7 @@
8080

8181
before do
8282
# Stub out authentication
83-
allow(request.env['warden']).to receive(:authenticate!).and_return(invalid_user)
83+
allow(request.env["warden"]).to receive(:authenticate!).and_return(invalid_user)
8484
allow(controller).to receive(:current_user).and_return(invalid_user)
8585
end
8686

0 commit comments

Comments
 (0)