You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As mentioned in #240 which introduces the missing-default-case rule, some annotations can take up a lot of space in the terminal. Another example is old-style-array-literal:
program p
implicit nonereal:: x(40)
x(:) = (/ &
0, &
1, &
2, &
...
37, &
38, &
39/)
write (*,*) x
end program p
When running fortitude check --select=old-style-array-literal with the default output format, the entire array is annotated. Ideally, the annotation should be truncated or abbreviated in some way.
The text was updated successfully, but these errors were encountered:
Turns out there's a fold argument that does this, except it also snips any context:
modified fortitude/src/message/text.rs
@@ -213,7 +213,8 @@ impl Display for MessageCodeFrame<'_> {
let snippet = Level::None.title("").snippet(
Snippet::source(&source_text)
.line_start(start_index.get())
- .annotation(Level::Error.span(start_byte..end_byte).label(&code)),+ .annotation(Level::Error.span(start_byte..end_byte).label(&code))+ .fold(true),
);
let snippet_with_footer = if let Some(s) = self.message.suggestion() {
gives output like:
test.f90:84:5: T003 [*] 'implicit none' set on the enclosing module
|
84 | implicit none
| ^^^^^^^^^^^^^ T003
|
= help: Remove unnecessary 'implicit none'
fortitude/resources/test/fixtures/bugprone/B001.f90:4:3: B001 Missing default case may not handle all values
|
4 | / select case(foo)
5 | | case(1)
... |
8 | | print*, "two"
9 | | end select
| |____________^ B001
|
= help: Add 'case default'
We could selectively turn it on if the range spans more than some number of lines. Maybe we can add the context as additional snippets? I'm not sure if it merges them or not.
As mentioned in #240 which introduces the
missing-default-case
rule, some annotations can take up a lot of space in the terminal. Another example isold-style-array-literal
:When running
fortitude check --select=old-style-array-literal
with the default output format, the entire array is annotated. Ideally, the annotation should be truncated or abbreviated in some way.The text was updated successfully, but these errors were encountered: