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

completions: add pre-commit #9521

Merged
merged 1 commit into from
Feb 5, 2023
Merged

Conversation

branchvincent
Copy link
Contributor

Description

Adds completions for pre-commit, a framework to manage/run pre-commit hooks.

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.rst

Comment on lines 7 to 10
function __fish_pre_commit_config_print -a key
test -r .pre-commit-config.yaml && string match -rg "\s+$key:\s+(\S+)" <.pre-commit-config.yaml | string unescape
end
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we can do better, but this parses the yaml config file while trying to tolerant comments and different quoting styles like:

- id: unquoted # comment
- id: 'single-quoted'
- id: "double-quoted"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I know anything, so let's just keep it like that for now.

@faho faho added this to the fish 3.6.1 milestone Feb 5, 2023
@faho faho merged commit d69a290 into fish-shell:master Feb 5, 2023
@faho
Copy link
Member

faho commented Feb 5, 2023

Merged, thanks!

@branchvincent branchvincent deleted the pre-commit branch February 5, 2023 18:21
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants