dense-analysis / dense-analysis/ale

`lstlisting` environment it not treated as `verbatim`, which results in several false positives

Open
#4,350 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Vim Script
Stars
14k
Forks
1.5k
Avg merge
17h 49m
Merged PRs (30d)
1

Description

## Information

**VIM version**

VIM - Vi IMproved 8.1 (2018 May 18, compiled Sep 19 2022 04:59:57)
Included patches: 1-2269, 3612, 3625, 3669, 3741

Operating System: windows 10, running ubuntu 20.04.5 LTS in the terminal

## What went wrong

ALE does not treat text inside of listing environments like verbatim, which spawns many whitespace related errors (i.e. space before punctuation marks, etc.). I've found somewhat of an answer on StackExchange [here](https://tex.stackexchange.com/questions/285301/ignore-errors-in-environments-in-latex-suite-in-vim), however this seems to be outdated, and does not work. After a bit of researching I've found that in order to solve this I simply need to add listings to append the texzone variable, which will make vim ignore all errors within the confines of the listing. I'd like to know how I can accomplish this, or how to solve the problem in general. I believe that [this piece of code](https://github.com/vim/vim/blob/master/runtime/syntax/tex.vim#L639) is concerned.

## Reproducing the bug

1. insert any listing environment into a latex document in vim

### :ALEInfo

Expand

o
Current Filetype: tex
Available Linters: ['alex', 'chktex', 'lacheck', 'proselint', 'redpen', 'vale', 'write-good']
Enabled Linters: ['alex', 'chktex', 'lacheck', 'proselint', 'redpen', 'vale', 'write-good']
Linter Variables:

let g:ale_tex_chktex_executable = 'chktex'
let g:ale_tex_chktex_options = '-I'
let g:ale_tex_lacheck_executable = 'lacheck'
Global Variables:

let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = v:null
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = v:null
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%code: %%s'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 0
let g:ale_fixers = {}
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'always'
let g:ale_lint_on_insert_leave = 0
let g:ale_linter_aliases = {}
let g:ale_linters = {}
let g:ale_linters_explicit = 0
let g:ale_list_window_size = 10
let g:ale_list_vertical = 1
let g:ale_loclist_msg_format = '%code: %%s'
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = -1
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 0
let g:ale_pattern_options = {}
let g:ale_pattern_options_enabled = 0
let g:ale_set_balloons = 1
let g:ale_set_highlights = 1
let g:ale_set_loclist = 0
let g:ale_set_quickfix = 1
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = '×'
let g:ale_sign_info = '!'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = '×'
let g:ale_sign_style_warning = '!'
let g:ale_sign_warning = '!'
let g:ale_statusline_format = v:null
let g:ale_type_map = {}
let g:ale_use_global_executables = v:null
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
Command History:

(executable check - failure) alex
(executable check - success) chktex
(started) ['/bin/bash', '-c', 'chktex -v0 -p stdin -q -I < ''/tmp/vHcNqS9/2/c5x-2-ln.tex''']
(executable check - success) lacheck
(started) ['/bin/bash', '-c', 'lacheck ''/tmp/vHcNqS9/3/c5x-2-ln.tex''']
(executable check - failure) proselint
(executable check - failure) redpen
(executable check - failure) vale
(executable check - failure) write-good
(executable check - failure) alex
(finished - exit code 2) ['/bin/bash', '-c', 'chktex -v0 -p stdin -q -I < ''/tmp/vHcNqS9/4/c5x-2-ln.tex''']

<<>>
stdin:153:24:13:Intersentence spacing (`\@') should perhaps be used.
stdin:162:25:26:You ought to remove spaces in front of punctuation.
stdin:289:63:1:Command terminated with space.
<<>>

(finished - exit code 0) ['/bin/bash', '-c', 'lacheck ''/tmp/vHcNqS9/5/c5x-2-ln.tex''']

<<>>
"/tmp/vHcNqS9/5/c5x-2-ln.tex", line 73: Whitespace before punctation mark in " ."
"/tmp/vHcNqS9/5/c5x-2-ln.tex", line 80: Whitespace before punctation mark in "
."
."
"/tmp/vHcNqS9/5/c5x-2-ln.tex", line 82: Whitespace before punctation mark in "
."
"/tmp/vHcNqS9/5/c5x-2-ln.tex", line 86: Whitespace before punctation mark in "
."
"/tmp/vHcNqS9/5/c5x-2-ln.tex", line 87: Whitespace before punctation mark in "
."
"/tmp/vHcNqS9/5/c5x-2-ln.tex", line 88: Whitespace before punctation mark in "
."
"/tmp/vHcNqS9/5/c5x-2-ln.tex", line 91: Whitespace before punctation mark in "
."
"/tmp/vHcNqS9/5/c5x-2-ln.tex", line 96: Whitespace before punctation mark in " ."
"/tmp/vHcNqS9/5/c5x-2-ln.tex", line 99: Whitespace before punctation mark in " ."
"/tmp/vHcNqS9/5/c5x-2-ln.tex", line 103: Whitespace before punctation mark in "
."
"/tmp/vHcNqS9/5/c5x-2-ln.tex", line 162: Whitespace before punctation mark in " ?"
"/tmp/vHcNqS9/5/c5x-2-ln.tex", line 246: Whitespace before punctation mark in " !"
"/tmp/vHcNqS9/5/c5x-2-ln.tex", line 324: Whitespace before punctation mark in "
."
"/tmp/vHcNqS9/5/c5x-2-ln.tex", line 337: Whitespace before punctation mark in " !"
"/tmp/vHcNqS9/5/c5x-2-ln.tex", line 349: Whitespace before punctation mark in "
."
"/tmp/vHcNqS9/5/c5x-2-ln.tex", line 351: Whitespace before punctation mark in "
."
<<>>
(executable check - failure) proselint
(executable check - failure) redpen
(executable check - failure) vale
(executable check - failure) write-good

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.