Skip to content

Commit

Permalink
Add support for the ruff formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
offbyone committed Nov 4, 2023
1 parent 4178439 commit 8dcf15a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apheleia-formatters.el
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@
"--stderr" "--format" "quiet" "--fail-level" "fatal"))
(ruby-standard . ("standardrb" "--stdin" filepath "--fix" "--stderr"
"--format" "quiet" "--fail-level" "fatal"))
(ruff . ("ruff" "format"
"--silent"
(apheleia-formatters-fill-column "--line-length")
"--stdin-filename" filepath
"-"))
(shfmt . ("shfmt"
"-filename" filepath
"-ln" (cl-case (bound-and-true-p sh-shell)
Expand Down
2 changes: 2 additions & 0 deletions test/formatters/installers/ruff.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
apt-get install -y python3-pip
pip install ruff
4 changes: 4 additions & 0 deletions test/formatters/samplecode/ruff/in.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
def asdjf ( l,
a):
3
+4
3 changes: 3 additions & 0 deletions test/formatters/samplecode/ruff/out.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def asdjf(l, a):
3
+4

0 comments on commit 8dcf15a

Please sign in to comment.