Skip to content

Commit 205becd

Browse files
committed
Standardize the use of single/double quotes
Single qoutes should be used for symbol-like/identifier strings and double quotes for everything else. I know this is quite vague but it suits me. Inspired by http://stackoverflow.com/a/56190
1 parent 85adc3b commit 205becd

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

src/analyses.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def __init__(self):
3939

4040
@property
4141
def name(self):
42-
return "word_frequency"
42+
return 'word_frequency'
4343

4444
def analyze_commit(self, author, repo, lines, message):
4545
words = message.split(" ")
@@ -70,7 +70,7 @@ def state(self, value):
7070
class FirstWordFrequencyAnalysis(WordFrequencyAnalysis):
7171
@property
7272
def name(self):
73-
return "first_word_frequency"
73+
return 'first_word_frequency'
7474

7575
def analyze_commit(self, author, repo, lines, message):
7676
words = message.split(" ")
@@ -85,10 +85,10 @@ def analyze_commit(self, author, repo, lines, message):
8585
class VerbFormAnalysis(Analysis):
8686
def __init__(self):
8787
self.forms = [
88-
"imperative",
89-
"gerund",
90-
"third_person",
91-
"past_tense"
88+
'imperative',
89+
'gerund',
90+
'third_person',
91+
'past_tense'
9292
]
9393

9494
self.lists = {}
@@ -107,7 +107,7 @@ def __init__(self):
107107

108108
@property
109109
def name(self):
110-
return "verb_form"
110+
return 'verb_form'
111111

112112
def analyze_commit(self, author, repo, lines, message):
113113
word = message.split(" ")[0].lower()
@@ -162,7 +162,7 @@ def __init__(self):
162162

163163
@property
164164
def name(self):
165-
return "message_length"
165+
return 'message_length'
166166

167167
def analyze_commit(self, author, repo, lines, message):
168168
length = len(message)
@@ -182,7 +182,7 @@ def __init__(self):
182182

183183
@property
184184
def name(self):
185-
return "message_line_count"
185+
return 'message_line_count'
186186

187187
def analyze_commit(self, author, repo, lines, message):
188188
if lines in self.lineCounts:
@@ -211,7 +211,7 @@ def __init__(self):
211211

212212
@property
213213
def name(self):
214-
return "binary"
214+
return 'binary'
215215

216216
def analyze_commit(self, author, repo, lines, message):
217217
if len(message) > 0:

src/generate_conjugations.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
forms = ['imperative', 'third_person', 'gerund', 'past_tense']
1111
for form in forms:
12-
file = open_file_dir_safe(f"{Directories.processed_data}/{form}.txt", "w")
12+
file = open_file_dir_safe(f"{Directories.processed_data}/{form}.txt", 'w')
1313
with file:
1414
for word in infinitives:
1515
method = getattr(generator, form)

src/plotters.py

+17-17
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def init_plot(self):
102102
class WordFrequencyPlotter(BarPlotter):
103103
@property
104104
def name(self):
105-
return "word_frequency"
105+
return 'word_frequency'
106106

107107
@property
108108
def title(self):
@@ -131,7 +131,7 @@ def compute_values(self):
131131
class FirstWordFrequencyPlotter(WordFrequencyPlotter):
132132
@property
133133
def name(self):
134-
return "first_word_frequency"
134+
return 'first_word_frequency'
135135

136136
@property
137137
def title(self):
@@ -141,11 +141,11 @@ def title(self):
141141
class VerbFormOverviewPlotter(BarPlotter):
142142
@property
143143
def name(self):
144-
return "verb_form_overview"
144+
return 'verb_form_overview'
145145

146146
@property
147147
def input_file_name(self):
148-
return "verb_form"
148+
return 'verb_form'
149149

150150
@property
151151
def title(self):
@@ -176,11 +176,11 @@ def form(self):
176176

177177
@property
178178
def name(self):
179-
return f"verb_form_{self.form}_frequency"
179+
return f'verb_form_{self.form}_frequency'
180180

181181
@property
182182
def input_file_name(self):
183-
return "verb_form"
183+
return 'verb_form'
184184

185185
@property
186186
def title(self):
@@ -202,31 +202,31 @@ def compute_values(self):
202202
class ImperativePlotter(VerbFormWordsPlotter):
203203
@property
204204
def form(self):
205-
return "imperative"
205+
return 'imperative'
206206

207207

208208
class GerundWordsPlotter(VerbFormWordsPlotter):
209209
@property
210210
def form(self):
211-
return "gerund"
211+
return 'gerund'
212212

213213

214214
class ThirdPersonWordsPlotter(VerbFormWordsPlotter):
215215
@property
216216
def form(self):
217-
return "third_person"
217+
return 'third_person'
218218

219219

220220
class PastTenseWordsPlotter(VerbFormWordsPlotter):
221221
@property
222222
def form(self):
223-
return "past_tense"
223+
return 'past_tense'
224224

225225

226226
class MessageLengthPlotter(LinePlotter):
227227
@property
228228
def name(self):
229-
return "message_length"
229+
return 'message_length'
230230

231231
@property
232232
def title(self):
@@ -249,7 +249,7 @@ def compute_values(self):
249249
class MessageLinesPlotter(LinePlotter):
250250
@property
251251
def name(self):
252-
return "message_line_count"
252+
return 'message_line_count'
253253

254254
@property
255255
def title(self):
@@ -272,7 +272,7 @@ def compute_values(self):
272272
class BinaryAnalysesPlotter(BarPlotter):
273273
@property
274274
def name(self):
275-
return "binary"
275+
return 'binary'
276276

277277
@property
278278
def title(self):
@@ -290,10 +290,10 @@ def compute_values(self):
290290
total_count = self.data['total']
291291

292292
labels = {
293-
'capital_letter': 'Capital letter',
294-
'full_stop': 'Full stop',
295-
'capslock': 'CAPSLOCK ON',
296-
'non_ascii_chars': 'Contains non-ASCII chars'
293+
'capital_letter': "Capital letter",
294+
'full_stop': "Full stop",
295+
'capslock': "CAPSLOCK ON",
296+
'non_ascii_chars': "Contains non-ASCII chars"
297297
}
298298

299299
values = [

src/process_verbs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
input_file = open(f"{Directories.raw_data}/verbs.txt")
88
output_file =\
9-
open_file_dir_safe(f"{Directories.processed_data}/infinitive.txt", "w")
9+
open_file_dir_safe(f"{Directories.processed_data}/infinitive.txt", 'w')
1010

1111
with input_file, output_file:
1212
for line in input_file:

0 commit comments

Comments
 (0)