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

Add support for dynamically computing lint_file #3285

Closed
w0rp opened this issue Aug 13, 2020 · 0 comments
Closed

Add support for dynamically computing lint_file #3285

w0rp opened this issue Aug 13, 2020 · 0 comments
Assignees

Comments

@w0rp
Copy link
Member

w0rp commented Aug 13, 2020

Sometimes an update to some software can mean that a linter that could only run on save before is now able to run on every text edit. Because ALE maintains compatibility with older version of many different tools, ALE needs to be able to conditionally run some linters either only on save or when text changes are made. To that end, we should make it so lint_file can be computed dynamically.

Similar to options like executable and command, the lint_file option should support being set as Function. The function should be able to return either a Number or an ALE deferred object, such as one returned by ale#command#Run.

The most obvious use of this is that we'll be able to use ale#semver#RunWithVersionCheck to apply a version check that we can cache and later return 0 or 1 based on the version of the tool. Because the version check and the successful executable checks are cached in ALE, we can run exactly the same check again when running the command to change the arguments to work when saving the file or whenever text is changed.

@w0rp w0rp self-assigned this Aug 13, 2020
@w0rp w0rp added this to To Do in On the Radar via automation Aug 13, 2020
@w0rp w0rp moved this from To Do to In Progress in On the Radar Aug 13, 2020
@w0rp w0rp closed this as completed in 34e409e Aug 28, 2020
On the Radar automation moved this from In Progress to Done Aug 28, 2020
jsit added a commit to jsit/ale that referenced this issue Aug 28, 2020
* master: (195 commits)
  Close dense-analysis#3285 - lint_file is now dynamic
  Close dense-analysis#3309 - Add b:ale_lint_delay
  Fix dense-analysis#3323 - Set default for g:ale_filename_mappings
  Add sql-lint to supported tools
  dense-analysis#3324 - Enable rls by default
  Set prettier working directory to where .prettierignore is (dense-analysis#3101)
  Fix dense-analysis#3319 - Force modifications to buffers
  Fix dense-analysis#3318 - Escape macros when parsing C flags
  Fix C flag parsing and tests on Windows
  Mention --fast, and document running Windows tests locally
  dense-analysis#3318 Refactor C flag parsing to set up for quoting arguments
  dense-analysis#3266 - Catch echo visual selection errors
  Label the test cases more clearly
  Fix dense-analysis#3317 - Parse -include from C flags
  Fix dense-analysis#3316 - Repeat -relative for ALERepeatSelection
  Fix dense-analysis#3307 - Handle compile_commands paths better
  Fix a typo
  dense-analysis#3314 - Tell people how to make new plug mappings
  dense-analysis#3312 - Just check if additionalTextEdits is non-empty
  Fix dense-analysis#3312 - Fix a false positive for auto imports
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

1 participant