Skip to content

Commit 8905da4

Browse files
committed
Follows style guide
1 parent fb307c2 commit 8905da4

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

server/src/__tests__/analyzer.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ describe('commentsAbove', () => {
201201
it('handles line breaks in comments', () => {
202202
analyzer.analyze(CURRENT_URI, FIXTURES.COMMENT_DOC)
203203
expect(analyzer.commentsAbove(CURRENT_URI, 28)).toEqual(
204-
'doc for func_two\nhas two lines',
204+
'doc for func_two\nhas two lines',
205205
)
206206
})
207207

@@ -239,8 +239,7 @@ describe('fromRoot', () => {
239239

240240
expect(connection.window.showWarningMessage).not.toHaveBeenCalled()
241241

242-
// TODO: maybe not hardcode this number in case
243-
// fixture files are added in the future?
242+
// if you add a .sh file to testing/fixtures, update this value
244243
const FIXTURE_FILES_MATCHING_GLOB = 11
245244

246245
// Intro, stats on glob, one file skipped due to shebang, and outro

server/src/analyser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ export default class Analyzer {
415415
// is not a comment line
416416
const getComment = (l: string): null | string => {
417417
// this regexp has to be defined within the function
418-
const commentRegExp = /^\s*\#\s*(.*)/g
418+
const commentRegExp = /^\s*#\s*(.*)/g
419419
const matches = commentRegExp.exec(l)
420420
return matches ? matches[1].trim() : null
421421
}
@@ -428,7 +428,7 @@ export default class Analyzer {
428428
// iterate on every line above and including
429429
// the current line until getComment returns null
430430
let currentComment: string | null = ''
431-
while (currentComment = getComment(currentLine)) {
431+
while ((currentComment = getComment(currentLine))) {
432432
commentBlock.push(currentComment)
433433
commentBlockIndex -= 1
434434
currentLine = doc.getText({

0 commit comments

Comments
 (0)