Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent ALE from linting diffs #2399

Closed
bdielman opened this issue Mar 28, 2019 · 6 comments
Closed

Prevent ALE from linting diffs #2399

bdielman opened this issue Mar 28, 2019 · 6 comments
Labels

Comments

@bdielman
Copy link

I use Vim as my diff and merge tool for Git. When running Gdiff in a file in Vim, I get the split window with diffs displayed with no issues (linting). When I run the difftool alias for Git from the command line, it opens up a similar split, but this time index version of the file is pulling from a temp directory /private/vars/folder and ALE lints the file. It seems that because this file is outside of the repo it doesn't use the rubocop config and seems to pull from a default set of rules.

Ideally, ALE wouldn't lint files when viewed via vimdiff or Gdiff.

@bdielman bdielman changed the title Prevent ALE from lifting diffs Prevent ALE from linting diffs Mar 28, 2019
@w0rp
Copy link
Member

w0rp commented Mar 29, 2019

Do you know if there's some way to detect if a Vim buffer is a buffer being used for displaying diffs with common plugins?

@w0rp w0rp added this to To Do in Old Working List via automation Mar 29, 2019
@bdielman
Copy link
Author

Not that I can see, but I'm still looking into it.

@resolritter
Copy link
Contributor

as an extra for gina, it also uses file protocols gina://* and custom filetypes for all of its views (that I know of)

image

@Christian-Gibbons
Copy link
Contributor

I have an autocommand in my vimrc to at least not open up the loclist for a diff. It's probably not a perfect solution, but it might give you an idea of what to do.

   augroup ale
      autocmd VimEnter * if(&diff) | let g:ale_open_list = 0 | endif
   augroup END

@w0rp w0rp added bug and removed enhancement labels Apr 8, 2019
@w0rp w0rp closed this as completed in 9a0ece1 Apr 8, 2019
Old Working List automation moved this from To Do to Done Apr 8, 2019
@w0rp
Copy link
Member

w0rp commented Apr 8, 2019

git pull and try it again. ALE should now avoid checking buffers where &diff is set.

Hnasar added a commit to Hnasar/ale that referenced this issue Jul 22, 2019
Hnasar added a commit to Hnasar/ale that referenced this issue Sep 4, 2019
Hnasar added a commit to Hnasar/ale that referenced this issue Oct 2, 2019
Hnasar added a commit to Hnasar/ale that referenced this issue Oct 18, 2019
Hnasar added a commit to Hnasar/ale that referenced this issue Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants