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

lint_mode "save only" missing #1222

Closed
adamcobabe opened this issue Mar 15, 2018 · 6 comments
Closed

lint_mode "save only" missing #1222

adamcobabe opened this issue Mar 15, 2018 · 6 comments

Comments

@adamcobabe
Copy link

Not sure why "save only" lint_mode is missing in the new version. Please bring it back.

@FichteFoll
Copy link
Contributor

It's right there:

// Lint Modes determine when the linter is run
// background: asynchronously on every change
// load_save: when a file is opened and every time it's saved
// manual: only when calling the Lint This View command
"lint_mode": "background",

@gvuyk
Copy link

gvuyk commented Mar 16, 2018

"load_save" != "save_only"
It was nice for reading other people's code

@braver
Copy link
Member

braver commented Mar 16, 2018

Why not use “manual” for that?

@adamcobabe
Copy link
Author

Because it's nice to be able to view other's code and not see thousands of lint issues AND not have to remember to manually lint on my own code--two birds, one stone. Good for refactoring.

@braver
Copy link
Member

braver commented Mar 16, 2018

Well I can see that. Shouldn’t be hard to implement either.

@kaste
Copy link
Contributor

kaste commented Mar 16, 2018

I would like to see a change here for background mode as well and change the behavior of the BackendController.

We can have three modes (background|save|manual) plus a flag lint_on_load(true|false). Basically I could set background and lint_on_load to false for navigating through a code base, and linting would begin when I begin to write code.

Also to change: we hit on save in background mode which is not necessary.

	on_activated => skip if lint_on_load == false or lint_mode == manual
    on_save => skip if lint_mode != save
    on_modified => skip if lint_mode != background

This becomes a bit more complicated for

  • when saving a project file fire config_changed event
  • on_activate check if the syntax changed. For convenience we hit here bc there is a good chance that the assigned linters changed as well

Notable: if the config changes, we currently hit every view regardless of the lint_mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants