Skip to content

Commit adf4a1b

Browse files
authored
Merge pull request #97 from niall-byrne/master
feat(LEXER): support function names containing dots
2 parents 1f57145 + 13087c9 commit adf4a1b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/bashcov/lexer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def relevant?(line)
104104
line.start_with?(*IGNORE_START_WITH) ||
105105
line.end_with?(*IGNORE_END_WITH)
106106

107-
return false if line =~ /\A[a-zA-Z_][a-zA-Z0-9_\-:]*\(\)/ # function declared without the `function` keyword
107+
return false if line =~ /\A[a-zA-Z_][a-zA-Z0-9_\-:\.]*\(\)/ # function declared without the `function` keyword
108108
return false if line =~ /\A[^)]+\)\Z/ # case statement selector, e.g. `--help)`
109109

110110
true

spec/test_app/scripts/function.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ put-team-key() {
1818
echo put-team-key # 0
1919
}
2020

21-
abc::def() {
21+
abc::def.fn() {
2222
echo "${FUNCNAME[0]}" # 1
2323
}
2424

2525
f1 # 1
2626
f2 # 1
2727
__a-bc # 1
28-
abc::def # 1
28+
abc::def.fn # 1

0 commit comments

Comments
 (0)