learn_linter 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/learn_linter/contributing_linter.rb +32 -2
- data/lib/learn_linter/license_linter.rb +196 -1
- data/lib/learn_linter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7b24c3d4928caff106415638ef48e0b54884a7e
|
4
|
+
data.tar.gz: 8e195f83c0dbf12294df74553f330a454b250b81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4db4c6ae826f63f0b8a62571ffb5cd24fc683a790e854cdd584c459b5622af9c17777f5e3e67a392305ede1d71da53440c1b842b65a2caa4cb511e0a81be0464
|
7
|
+
data.tar.gz: daeef09e0219eeff2576fc018352bed83ec440f559cd32767d6025dac60fc1bf9bcc75c8968a1acfddd7a54bacbd4adbf6845b530c3cd3814eea774602cdfbe5
|
@@ -4,8 +4,8 @@ class ContributingLinter
|
|
4
4
|
|
5
5
|
def self.parse_file(file, learn_error)
|
6
6
|
directory_file = File.open(file).read
|
7
|
-
valid_file = VALID_FILE.read
|
8
|
-
if sanitize_whitespace(directory_file) ==
|
7
|
+
# valid_file = VALID_FILE.read
|
8
|
+
if sanitize_whitespace(directory_file) == valid_contributing
|
9
9
|
learn_error.contributing_error[:valid_contributing] = true
|
10
10
|
learn_error.valid_contributing = {message: "valid contributing", color: :green}
|
11
11
|
end
|
@@ -14,4 +14,34 @@ class ContributingLinter
|
|
14
14
|
def self.sanitize_whitespace(file)
|
15
15
|
file.split("\n").delete_if { |l| l.empty? }
|
16
16
|
end
|
17
|
+
|
18
|
+
def self.valid_contributing
|
19
|
+
["# Contributing to Learn.co Curriculum",
|
20
|
+
"We're really exited that you're about to contribute to the [open curriculum](https://learn.co/content-license) on [Learn.co](https://learn.co). If this is your first time contributing, please continue reading to learn how to make the most meaningful and useful impact possible.",
|
21
|
+
"## Raising an Issue to Encourage a Contribution",
|
22
|
+
"If you notice a problem with the curriculum that you believe needs improvement",
|
23
|
+
"but you're unable to make the change yourself, you should raise a Github issue",
|
24
|
+
"containing a clear description of the problem. Include relevant snippets of",
|
25
|
+
"the content and/or screenshots if applicable. Curriculum owners regularly review",
|
26
|
+
"issue lists and your issue will be prioritized and addressed as appropriate.",
|
27
|
+
"## Submitting a Pull Request to Suggest an Improvement",
|
28
|
+
"If you see an opportunity for improvement and can make the change yourself go",
|
29
|
+
"ahead and use a typical git workflow to make it happen:",
|
30
|
+
"* Fork this curriculum repository",
|
31
|
+
"* Make the change on your fork, with descriptive commits in the standard format",
|
32
|
+
"* Open a Pull Request against this repo",
|
33
|
+
"A curriculum owner will review your change and approve or comment on it in due",
|
34
|
+
"course.",
|
35
|
+
"# Why Contribute?",
|
36
|
+
"Curriculum on Learn is publicly and freely available under Learn's",
|
37
|
+
"[Educational Content License](https://learn.co/content-license). By",
|
38
|
+
"embracing an open-source contribution model, our goal is for the curriculum",
|
39
|
+
"on Learn to become, in time, the best educational content the world has",
|
40
|
+
"ever seen.",
|
41
|
+
"We need help from the community of Learners to maintain and improve the",
|
42
|
+
"educational content. Everything from fixing typos, to correcting",
|
43
|
+
"out-dated information, to improving exposition, to adding better examples,",
|
44
|
+
"to fixing tests—all contributions to making the curriculum more effective are",
|
45
|
+
"welcome."]
|
46
|
+
end
|
17
47
|
end
|
@@ -6,7 +6,7 @@ class LicenseLinter
|
|
6
6
|
def self.parse_file(file, learn_error)
|
7
7
|
directory_file = File.open(file).read
|
8
8
|
valid_file = VALID_FILE.read
|
9
|
-
if sanitize_whitespace(directory_file) ==
|
9
|
+
if sanitize_whitespace(directory_file) == valid_license
|
10
10
|
learn_error.license_error[:valid_license] = true
|
11
11
|
learn_error.valid_license = {message: "valid license", color: :green}
|
12
12
|
end
|
@@ -15,4 +15,199 @@ class LicenseLinter
|
|
15
15
|
def self.sanitize_whitespace(file)
|
16
16
|
file.split.delete_if {|char| char.empty? || char == "\n"}
|
17
17
|
end
|
18
|
+
|
19
|
+
def self.valid_license
|
20
|
+
["#Learn.co",
|
21
|
+
"Educational",
|
22
|
+
"Content",
|
23
|
+
"License",
|
24
|
+
"Copyright",
|
25
|
+
"(c)",
|
26
|
+
"2015",
|
27
|
+
"Flatiron",
|
28
|
+
"School,",
|
29
|
+
"Inc",
|
30
|
+
"The",
|
31
|
+
"Flatiron",
|
32
|
+
"School,",
|
33
|
+
"Inc.",
|
34
|
+
"owns",
|
35
|
+
"this",
|
36
|
+
"Educational",
|
37
|
+
"Content.",
|
38
|
+
"However,",
|
39
|
+
"the",
|
40
|
+
"Flatiron",
|
41
|
+
"School",
|
42
|
+
"supports",
|
43
|
+
"the",
|
44
|
+
"development",
|
45
|
+
"and",
|
46
|
+
"availability",
|
47
|
+
"of",
|
48
|
+
"educational",
|
49
|
+
"materials",
|
50
|
+
"in",
|
51
|
+
"the",
|
52
|
+
"public",
|
53
|
+
"domain.",
|
54
|
+
"Therefore,",
|
55
|
+
"the",
|
56
|
+
"Flatiron",
|
57
|
+
"School",
|
58
|
+
"grants",
|
59
|
+
"Users",
|
60
|
+
"of",
|
61
|
+
"the",
|
62
|
+
"Flatiron",
|
63
|
+
"Educational",
|
64
|
+
"Content",
|
65
|
+
"set",
|
66
|
+
"forth",
|
67
|
+
"in",
|
68
|
+
"this",
|
69
|
+
"repository",
|
70
|
+
"certain",
|
71
|
+
"rights",
|
72
|
+
"to",
|
73
|
+
"reuse,",
|
74
|
+
"build",
|
75
|
+
"upon",
|
76
|
+
"and",
|
77
|
+
"share",
|
78
|
+
"such",
|
79
|
+
"Educational",
|
80
|
+
"Content",
|
81
|
+
"subject",
|
82
|
+
"to",
|
83
|
+
"the",
|
84
|
+
"terms",
|
85
|
+
"of",
|
86
|
+
"the",
|
87
|
+
"Educational",
|
88
|
+
"Content",
|
89
|
+
"License",
|
90
|
+
"set",
|
91
|
+
"forth",
|
92
|
+
"[here](http://learn.co/content-license)",
|
93
|
+
"(http://learn.co/content-license).",
|
94
|
+
"You",
|
95
|
+
"must",
|
96
|
+
"read",
|
97
|
+
"carefully",
|
98
|
+
"the",
|
99
|
+
"terms",
|
100
|
+
"and",
|
101
|
+
"conditions",
|
102
|
+
"contained",
|
103
|
+
"in",
|
104
|
+
"the",
|
105
|
+
"Educational",
|
106
|
+
"Content",
|
107
|
+
"License",
|
108
|
+
"as",
|
109
|
+
"such",
|
110
|
+
"terms",
|
111
|
+
"govern",
|
112
|
+
"access",
|
113
|
+
"to",
|
114
|
+
"and",
|
115
|
+
"use",
|
116
|
+
"of",
|
117
|
+
"the",
|
118
|
+
"Educational",
|
119
|
+
"Content.",
|
120
|
+
"Flatiron",
|
121
|
+
"School",
|
122
|
+
"is",
|
123
|
+
"willing",
|
124
|
+
"to",
|
125
|
+
"allow",
|
126
|
+
"you",
|
127
|
+
"access",
|
128
|
+
"to",
|
129
|
+
"and",
|
130
|
+
"use",
|
131
|
+
"of",
|
132
|
+
"the",
|
133
|
+
"Educational",
|
134
|
+
"Content",
|
135
|
+
"only",
|
136
|
+
"on",
|
137
|
+
"the",
|
138
|
+
"condition",
|
139
|
+
"that",
|
140
|
+
"you",
|
141
|
+
"accept",
|
142
|
+
"all",
|
143
|
+
"of",
|
144
|
+
"the",
|
145
|
+
"terms",
|
146
|
+
"and",
|
147
|
+
"conditions",
|
148
|
+
"contained",
|
149
|
+
"in",
|
150
|
+
"the",
|
151
|
+
"Educational",
|
152
|
+
"Content",
|
153
|
+
"License",
|
154
|
+
"set",
|
155
|
+
"forth",
|
156
|
+
"[here](http://learn.co/content-license)",
|
157
|
+
"(http://learn.co/content-license).",
|
158
|
+
"By",
|
159
|
+
"accessing",
|
160
|
+
"and/or",
|
161
|
+
"using",
|
162
|
+
"the",
|
163
|
+
"Educational",
|
164
|
+
"Content,",
|
165
|
+
"you",
|
166
|
+
"are",
|
167
|
+
"agreeing",
|
168
|
+
"to",
|
169
|
+
"all",
|
170
|
+
"of",
|
171
|
+
"the",
|
172
|
+
"terms",
|
173
|
+
"and",
|
174
|
+
"conditions",
|
175
|
+
"contained",
|
176
|
+
"in",
|
177
|
+
"the",
|
178
|
+
"Educational",
|
179
|
+
"Content",
|
180
|
+
"License.",
|
181
|
+
"If",
|
182
|
+
"you",
|
183
|
+
"do",
|
184
|
+
"not",
|
185
|
+
"agree",
|
186
|
+
"to",
|
187
|
+
"any",
|
188
|
+
"or",
|
189
|
+
"all",
|
190
|
+
"of",
|
191
|
+
"the",
|
192
|
+
"terms",
|
193
|
+
"of",
|
194
|
+
"the",
|
195
|
+
"Educational",
|
196
|
+
"Content",
|
197
|
+
"License,",
|
198
|
+
"you",
|
199
|
+
"are",
|
200
|
+
"prohibited",
|
201
|
+
"from",
|
202
|
+
"accessing,",
|
203
|
+
"reviewing",
|
204
|
+
"or",
|
205
|
+
"using",
|
206
|
+
"in",
|
207
|
+
"any",
|
208
|
+
"way",
|
209
|
+
"the",
|
210
|
+
"Educational",
|
211
|
+
"Content."]
|
212
|
+
end
|
18
213
|
end
|
data/lib/learn_linter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: learn_linter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sophie DeBenedetto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|