Skip to content

Commit

Permalink
✨ Add ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
Freed-Wu committed Feb 11, 2024
1 parent 8cb0c71 commit b1b2cce
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sources/ruff-check.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# :fzf-tab:complete:(\\|*/|)ruff-command-check:argument-rest
[[ -f $realpath ]] && ruff check --show-fixes --show-source -e $realpath || less $realpath
7 changes: 7 additions & 0 deletions sources/ruff-generate-shell-completion.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# :fzf-tab:complete:(\\|*/|)ruff-command-generate-shell-completion:argument-1
case $group in
shell)
ruff generate-shell-completion $word | bat -pl$word 2>/dev/null ||
ruff generate-shell-completion $word
;;
esac
6 changes: 6 additions & 0 deletions sources/ruff-rule.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# :fzf-tab:complete:(\\|*/|)ruff-command-rule:argument-1
case $group in
'rule -- Rule to explain')
ruff rule $word | mdcat
;;
esac
6 changes: 6 additions & 0 deletions sources/ruff.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# :fzf-tab:complete:(\\|*/|)ruff(|ruff-command-help):argument-1
case $group in
'ruff commands'|'ruff help commands')
ruff help $word | bat -plhelp
;;
esac

0 comments on commit b1b2cce

Please sign in to comment.