Skip to content

Conversation

@xiaoshihou514
Copy link
Member

@xiaoshihou514 xiaoshihou514 commented Dec 9, 2024

Add event API to provide control to guard autocmds.

  • unify Guard info with checkhealth
  • option for controlling debounce timer
  • events field in tool config
  • auto_lint option
  • Guard lint
  • Guard disable -> Guard disable-fmt
  • Guard enable -> Guard enable-fmt
  • Guard disable-lint
  • Guard enable-lint
  • Tests for linting functionality
  • Error reporting for linter
  • Other minor fixes and refactors
  • ! remove setup

@231tr0n
Copy link

231tr0n commented Dec 10, 2024

Apologies for commenting here but are we providing lint_on_save option similar to format_on_save.

@xiaoshihou514
Copy link
Member Author

@231tr0n The goal is to give full control over on what events what should happen.

@231tr0n
Copy link

231tr0n commented Dec 10, 2024

@231tr0n The goal is to give full control over on what events what should happen.

Ohh so lint_on_save, fmt_on_save and save_on_fmt are no more a thing is it?

@xiaoshihou514
Copy link
Member Author

I think I will keep the existing options as nice deafults.

@231tr0n
Copy link

231tr0n commented Dec 10, 2024

I think I will keep the existing options as nice deafults.

Just a suggestion but I think it would be better to probably remove these options and let users decide when to format and lint and just provide Guard fmt and Guard lint which they can use anywhere they wish to like in BufWrite and BufWritePost events. It also reduces the amount of code to be maintained creating a win-win situation. You are free to ignore this comment if you dont want to do it that way.

One more thing is if we are going to keep the options, then might as well provide lint_on_save since that makes sense as well.

@xiaoshihou514
Copy link
Member Author

Yeah I guess it makes sense.

Will call it auto_lint since it's not exactly lint on save.

@xiaoshihou514
Copy link
Member Author

Reminder to self:

  • individual event handling
  • check au attach needs to handle custom events

@xiaoshihou514
Copy link
Member Author

Need to rewrite the whole event module, will take a while to land

xiaoshihou514 and others added 7 commits December 23, 2024 12:03
Co-authored-by: glepnir <glephunter@gmail.com>
Co-authored-by: glepnir <glephunter@gmail.com>
Co-authored-by: glepnir <glephunter@gmail.com>
Co-authored-by: glepnir <glephunter@gmail.com>
Co-authored-by: glepnir <glephunter@gmail.com>
@xiaoshihou514 xiaoshihou514 merged commit 25ba07f into nvimdev:main Dec 23, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants