Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite670c97

Browse files
authored
Slang verilog Linter: set default searchpath and output filename (#4999)
* Sets module search path to file directory for slang/verilog linterSimilar to iverilog behaviour.See699c0dbReasonable default behaviour, can be changed by adding '-y%s:h' to`b:ale_verilog_slang_options` buffer variable.* Adds filename to slang/verilog linter outputslang can parse other files based on the modules instances names find inthe current file and returns warning/error messages related to thosefiles that have the same pattern.Adding the file name to the outputs avoid polluting the active bufferwith those messages.* Absolute paths in slang/verilog linter messagesOtherwise temp files are not correctly detected
1 parent0d1d0a9 commite670c97

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

‎ale_linters/verilog/slang.vim‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ endif
99
" --lint-only
1010
function!ale_linters#verilog#slang#GetCommand(buffer)abort
1111
return'slang -Weverything'
12+
\ .'--diag-abs-paths'
1213
\ .'-I%s:h'
14+
\ .'-y%s:h'
1315
\ .ale#Var(a:buffer,'verilog_slang_options') .''
1416
\ .'%t'
1517
endfunction
@@ -28,6 +30,7 @@ function! ale_linters#verilog#slang#Handle(buffer, lines) abort
2830

2931
forl:matchinale#util#GetMatches(a:lines,l:pattern)
3032
letl:item= {
33+
\'filename':l:match[1],
3134
\'lnum':str2nr(l:match[2]),
3235
\'type': (l:match[4]is#'error') ?'E' :'W',
3336
\'text':s:RemoveUnicodeQuotes(l:match[5]),

‎test/handler/test_slang_handler.vader‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ Execute(The slang handler should parse lines correctly):
88
AssertEqual
99
\ [
1010
\ {
11+
\ 'filename' : 'foo.sv',
1112
\ 'lnum': 11,
1213
\ 'col': 1,
1314
\ 'type': 'W',
1415
\ 'text': 'extra '';'' has no effect [-Wempty-member]',
1516
\ },
1617
\ {
18+
\ 'filename' : 'bar.sv',
1719
\ 'lnum': 24,
1820
\ 'col': 12,
1921
\ 'type': 'E',
@@ -22,5 +24,5 @@ Execute(The slang handler should parse lines correctly):
2224
\ ],
2325
\ ale_linters#verilog#slang#Handle(bufnr(''), [
2426
\ 'foo.sv:11:1: warning: extra '';'' has no effect [-Wempty-member]',
25-
\ 'foo.sv:24:12: error: cannot mix continuous and procedural assignments to variable ''data_o''',
27+
\ 'bar.sv:24:12: error: cannot mix continuous and procedural assignments to variable ''data_o''',
2628
\ ])

‎test/linter/test_slang.vader‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ After:
55
call ale#assert#TearDownLinterTest()
66

77
Execute(The default slang command should be correct):
8-
AssertLinter 'slang', 'slang -Weverything -I%s:h %t'
8+
AssertLinter 'slang', 'slang -Weverything --diag-abs-paths -I%s:h -y%s:h %t'
99

1010
Execute(slang options should be configurable):
1111
" Additional args for the linter
1212
let g:ale_verilog_slang_options = '--define-macro DWIDTH=12'
1313

14-
AssertLinter 'slang', 'slang -Weverything -I%s:h --define-macro DWIDTH=12 %t'
14+
AssertLinter 'slang', 'slang -Weverything --diag-abs-paths -I%s:h -y%s:h --define-macro DWIDTH=12 %t'

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp