Built from 715cfdecadad1cdd42a3e6b46ff6980278336ea7
.
Restyler | Language(s) | Version | Runs automatically? |
---|---|---|---|
astyle | C, C++, C#, Java*, Objective-C | v3.6.2 |
Yes |
autopep8 | Python | v2.3.1 |
Yes |
black | Python | v24.10.0 |
Yes |
brittany | Haskell | v0.14.0.2 |
No |
cabal-fmt | Haskell | v0.1.12 |
No |
clang-format | C, C++, Java, JavaScript, Objective-C, Protobuf, C# | v18.1.8 |
Yes |
cmake-format | CMake | 0.6.13-1 |
Yes |
dart-format | Dart | v2.3.4 |
Yes |
dfmt | D | v0.14.2 |
Yes |
dhall-format | Dhall | 1.42.1 |
Yes |
dotnet-format | C#, VB.NET | v5.1.250801 |
No |
elm-format | Elm | v0.6.1-alpha-3 |
Yes |
fantomas | F# | v3.3.0 |
Yes |
fourmolu | Haskell | v0.16.2.0 |
No |
gn | GN | v2 |
Yes |
gofmt | Go | go1.23.0 |
Yes |
google-java-format | Java | v1.9 |
No |
hindent | Haskell | v6.1.1 |
No |
hlint | Haskell | v3.5 |
No |
isort | Python | v5.13.2 |
Yes |
jdt | Java, JavaScript*, CSS, HTML, JSON, XML | v2.13.0 |
No |
jq | JSON | v1.6-3 |
No |
luaformatter | Lua | v1.3.6 |
Yes |
nixfmt | Nix | v0.6.0 |
Yes |
nixpkgs-fmt | Nix | v1.3.0 |
No |
npm-groovy-lint | Groovy | v15.0.2 |
Yes |
ocamlformat | OCaml | v0.26.2 |
Yes |
ormolu | Haskell | v0.5.3.0 |
No |
perltidy | Perl | v20230701 |
Yes |
pg_format | PSQL | v5.3 |
Yes |
php-cs-fixer | PHP | v3.67.1 |
Yes |
prettier | JavaScript | v3.4.2-3 |
Yes |
prettier-json | JSON | v3.4.2-3 |
Yes |
prettier-markdown | Markdown | v3.4.2-3 |
Yes |
prettier-yaml | Yaml | v3.4.2-3 |
Yes |
prettier-ruby | Ruby | v3.2.2-1 |
No |
purty | PureScript | v7.0.0 |
Yes |
pyment | Python | v0.3.3 |
Yes |
refmt | Reason | v3.3.3 |
Yes |
reorder-python-imports | Python | v3.14.0 |
Yes |
rubocop | Ruby | v1.70.0 |
No |
rustfmt | Rust | v1.7.1-stable |
Yes |
scalafmt | Scala | v3.7.10 |
No |
shellcheck | POSIX sh, Bash | v0.9.0 |
Yes |
shellharden | POSIX sh, Bash | v4.1.1-3 |
Yes |
shfmt | POSIX sh, Bash | v3.4.3 |
Yes |
sqlformat | SQL, PSQL | 0.5.3 |
No |
standardrb | Ruby | v1.43.0 |
Yes |
stylish-haskell | Haskell | v0.14.3.0 |
Yes |
taplo | TOML | 0.9.3 |
Yes |
terraform | Terraform | v0.12.24-2 |
Yes |
verible | System Verilog | v0.0-1318-gf6b4485 |
Yes |
whitespace | * | v0.2.0.0 |
Yes |
yapf | Python | v0.43.0-1 |
Yes |
Restyles C, C++, C#, Java*, Objective-C, runs automatically.
Documentation
Configuration
restylers:
- astyle:
arguments: []
command:
- astyle
image: restyled/restyler-astyle:v3.6.2
include:
- '**/*.c'
- '**/*.cc'
- '**/*.cpp'
- '**/*.cxx'
- '**/*.c++'
- '**/*.C'
- '**/*.cs'
- '**/*.h'
- '**/*.hh'
- '**/*.hpp'
- '**/*.hxx'
- '**/*.h++'
- '**/*.H'
- '**/*.m'
- '**/*.mm'
interpreters: []
Examples
Before
int Foo(bool isBar)
{
if (isBar) {
bar();
return 1; }
else
return 0;
}
After
int Foo(bool isBar)
{
if (isBar) {
bar();
return 1;
}
else
return 0;
}
Before
/* FEOF example */
#include <stdio.h>
int main()
{
FILE * pFile;
char buffer [100];
pFile = fopen ("myfile.txt" , "r");
if (pFile == NULL) perror ("Error opening file");
else {
while ( ! feof (pFile) ) {
if ( fgets (buffer , 100 , pFile) == NULL ) break;
fputs (buffer , stdout);
}
fclose (pFile);
}
return 0;
}
After
/* FEOF example */
#include <stdio.h>
int main()
{
FILE * pFile;
char buffer [100];
pFile = fopen ("myfile.txt", "r");
if (pFile == NULL) perror ("Error opening file");
else {
while (! feof (pFile) ) {
if ( fgets (buffer, 100, pFile) == NULL ) break;
fputs (buffer, stdout);
}
fclose (pFile);
}
return 0;
}
Restyles Python, runs automatically.
Documentation
Configuration
restylers:
- autopep8:
arguments: []
command:
- autopep8
- --in-place
image: restyled/restyler-autopep8:v2.3.1
include:
- '**/*.py'
interpreters:
- python
Examples
Before
import math, sys;
def example1():
####This is a long comment. This should be wrapped to fit within 72 characters.
some_tuple=( 1,2, 3,'a' );
some_variable={'long':'Long code lines should be wrapped within 79 characters.',
'other':[math.pi, 100,200,300,9876543210,'This is a long string that goes on'],
'more':{'inner':'This whole logical line should be wrapped.',some_tuple:[1,
20,300,40000,500000000,60000000000000000]}}
return (some_tuple, some_variable)
After
import math
import sys
def example1():
# This is a long comment. This should be wrapped to fit within 72 characters.
some_tuple = (1, 2, 3, 'a')
some_variable = {'long': 'Long code lines should be wrapped within 79 characters.',
'other': [math.pi, 100, 200, 300, 9876543210, 'This is a long string that goes on'],
'more': {'inner': 'This whole logical line should be wrapped.', some_tuple: [1,
20, 300, 40000, 500000000, 60000000000000000]}}
return (some_tuple, some_variable)
Restyles Python, runs automatically.
Documentation
Configuration
restylers:
- black:
arguments: []
command:
- black
image: public.ecr.aws/restyled-io/restyler-black:v24.10.0
include:
- '**/*.py'
interpreters:
- python
Examples
Before
import math, sys;
def example1():
####This is a long comment. This should be wrapped to fit within 72 characters.
some_tuple=( 1,2, 3,'a' );
some_variable={'long':'Long code lines should be wrapped within 79 characters.',
'other':[math.pi, 100,200,300,9876543210,'This is a long string that goes on'],
'more':{'inner':'This whole logical line should be wrapped.',some_tuple:[1,
20,300,40000,500000000,60000000000000000]}}
return (some_tuple, some_variable)
After
import math, sys
def example1():
####This is a long comment. This should be wrapped to fit within 72 characters.
some_tuple = (1, 2, 3, "a")
some_variable = {
"long": "Long code lines should be wrapped within 79 characters.",
"other": [
math.pi,
100,
200,
300,
9876543210,
"This is a long string that goes on",
],
"more": {
"inner": "This whole logical line should be wrapped.",
some_tuple: [1, 20, 300, 40000, 500000000, 60000000000000000],
},
}
return (some_tuple, some_variable)
Restyles Haskell, must be explicitly enabled.
Documentation
Configuration
restylers:
- brittany:
arguments: []
command:
- brittany
- --write-mode=inplace
image: public.ecr.aws/restyled-io/restyler-brittany:v0.14.0.2
include:
- '**/*.hs'
interpreters: []
Examples
Before
func (MyLongFoo abc def) = 1
func (Bar a d) = 2
func _ = 3
After
func (MyLongFoo abc def) = 1
func (Bar a d ) = 2
func _ = 3
Restyles Haskell, must be explicitly enabled.
Documentation
Configuration
restylers:
- cabal-fmt:
arguments: []
command:
- cabal-fmt
- --inplace
image: public.ecr.aws/restyled-io/restyler-cabal-fmt:v0.1.12
include:
- '**/*.cabal'
interpreters: []
Examples
Before
cabal-version: 2.4
name: cabal-fmt
version: 0
-- An example formatter
executable cabal-fmt
default-language: Haskell2010
hs-source-dirs: src
main-is: CabalFmt.hs
-- build depends will be in
-- a nice tabular format
build-depends: base >=4.11 && <4.13, pretty >=1.1.3.6 && <1.2, bytestring, Cabal ^>=2.5, containers ^>=0.5.11.0 || ^>=0.6.0.1
-- extensions will be sorted
other-extensions:
DeriveFunctor FlexibleContexts ExistentialQuantification OverloadedStrings
RankNTypes
After
cabal-version: 2.4
name: cabal-fmt
version: 0
-- An example formatter
executable cabal-fmt
default-language: Haskell2010
hs-source-dirs: src
main-is: CabalFmt.hs
-- build depends will be in
-- a nice tabular format
build-depends:
, base >=4.11 && <4.13
, bytestring
, Cabal ^>=2.5
, containers ^>=0.5.11.0 || ^>=0.6.0.1
, pretty >=1.1.3.6 && <1.2
-- extensions will be sorted
other-extensions:
DeriveFunctor
ExistentialQuantification
FlexibleContexts
OverloadedStrings
RankNTypes
Restyles C, C++, Java, JavaScript, Objective-C, Protobuf, C#, runs automatically.
Documentation
Configuration
restylers:
- clang-format:
arguments: []
command:
- clang-format
- -i
image: restyled/restyler-clang-format:v18.1.8
include:
- '**/*.c'
- '**/*.cc'
- '**/*.cpp'
- '**/*.cxx'
- '**/*.c++'
- '**/*.C'
- '**/*.cs'
- '**/*.h'
- '**/*.hh'
- '**/*.hpp'
- '**/*.hxx'
- '**/*.h++'
- '**/*.H'
- '**/*.java'
- '**/*.js'
- '**/*.m'
interpreters: []
Examples
Before
int formatted_code;
void unformatted_code ;
void formatted_code_again;
After
int formatted_code;
void unformatted_code;
void formatted_code_again;
Restyles CMake, runs automatically.
Documentation
Configuration
restylers:
- cmake-format:
arguments: []
command:
- cmake-format
- --in-place
image: restyled/restyler-cmake-format:0.6.13-1
include:
- '**/CMakeLists.txt'
- '**/*.cmake-format-test'
interpreters: []
Examples
Before
# The following multiple newlines should be collapsed into a single newline
cmake_minimum_required(VERSION 2.8.11)
project(cmakelang_test)
# This multiline-comment should be reflowed
# into a single comment
# on one line
# This comment should remain right before the command call.
# Furthermore, the command call should be formatted
# to a single line.
add_subdirectories(foo bar baz
foo2 bar2 baz2)
# This very long command should be wrapped
set(HEADERS very_long_header_name_a.h very_long_header_name_b.h very_long_header_name_c.h)
# This command should be split into one line per entry because it has a long argument list.
set(SOURCES source_a.cc source_b.cc source_d.cc source_e.cc source_f.cc source_g.cc source_h.cc)
# The string in this command should not be split
set_target_properties(foo bar baz PROPERTIES COMPILE_FLAGS "-std=c++11 -Wall -Wextra")
# This command has a very long argument and can't be aligned with the command
# end, so it should be moved to a new line with block indent + 1.
some_long_command_name("Some very long argument that really needs to be on the next line.")
# This situation is similar but the argument to a KWARG needs to be on a
# newline instead.
set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wno-sign-compare -Wno-unused-parameter -xx")
set(HEADERS header_a.h header_b.h # This comment should
# be preserved, moreover it should be split
# across two lines.
header_c.h header_d.h)
# This part of the comment should
# be formatted
# but...
# cmake-format: off
# This bunny should remain untouched:
# . _ ∩
# レヘヽ| |
# (・x・)
# c( uu}
# cmake-format: on
# while this part should
# be formatted again
# This is a paragraph
#
# This is a second paragraph
#
# This is a third paragraph
# This is a comment
# that should be joined but
# TODO(josh): This todo should not be joined with the previous line.
# NOTE(josh): Also this should not be joined with the todo.
if(foo)
if(sbar)
# This comment is in-scope.
add_library(foo_bar_baz foo.cc bar.cc # this is a comment for arg2
# this is more comment for arg2, it should be joined with the first.
baz.cc) # This comment is part of add_library
other_command(some_long_argument some_long_argument) # this comment is very long and gets split across some lines
other_command(some_long_argument some_long_argument some_long_argument) # this comment is even longer and wouldn't make sense to pack at the end of the command so it gets it's own lines
endif()
endif()
# This very long command should be broken up along keyword arguments
foo(nonkwarg_a nonkwarg_b HEADERS a.h b.h c.h d.h e.h f.h SOURCES a.cc b.cc d.cc DEPENDS foo bar baz)
# This command uses a string with escaped quote chars
foo(some_arg some_arg "This is a \"string\" within a string")
# This command uses an empty string
foo(some_arg some_arg "")
# This command uses a multiline string
foo(some_arg some_arg "
This string is on multiple lines
")
# No, I really want this to look ugly
# cmake-format: off
add_library(a b.cc
c.cc d.cc
e.cc)
# cmake-format: on
After
# The following multiple newlines should be collapsed into a single newline
cmake_minimum_required(VERSION 2.8.11)
project(cmakelang_test)
# This multiline-comment should be reflowed into a single comment on one line
# This comment should remain right before the command call. Furthermore, the
# command call should be formatted to a single line.
add_subdirectories(foo bar baz foo2 bar2 baz2)
# This very long command should be wrapped
set(HEADERS very_long_header_name_a.h very_long_header_name_b.h
very_long_header_name_c.h)
# This command should be split into one line per entry because it has a long
# argument list.
set(SOURCES
source_a.cc
source_b.cc
source_d.cc
source_e.cc
source_f.cc
source_g.cc
source_h.cc)
# The string in this command should not be split
set_target_properties(foo bar baz PROPERTIES COMPILE_FLAGS
"-std=c++11 -Wall -Wextra")
# This command has a very long argument and can't be aligned with the command
# end, so it should be moved to a new line with block indent + 1.
some_long_command_name(
"Some very long argument that really needs to be on the next line.")
# This situation is similar but the argument to a KWARG needs to be on a newline
# instead.
set(CMAKE_CXX_FLAGS
"-std=c++11 -Wall -Wno-sign-compare -Wno-unused-parameter -xx")
set(HEADERS
header_a.h header_b.h # This comment should be preserved, moreover it should
# be split across two lines.
header_c.h header_d.h)
# This part of the comment should be formatted but...
# cmake-format: off
# This bunny should remain untouched:
# . _ ∩
# レヘヽ| |
# (・x・)
# c( uu}
# cmake-format: on
# while this part should be formatted again
# This is a paragraph
#
# This is a second paragraph
#
# This is a third paragraph
# This is a comment that should be joined but
# TODO(josh): This todo should not be joined with the previous line.
# NOTE(josh): Also this should not be joined with the todo.
if(foo)
if(sbar)
# This comment is in-scope.
add_library(
foo_bar_baz
foo.cc bar.cc # this is a comment for arg2 this is more comment for arg2,
# it should be joined with the first.
baz.cc) # This comment is part of add_library
other_command(
some_long_argument some_long_argument) # this comment is very long and
# gets split across some lines
other_command(
some_long_argument some_long_argument some_long_argument) # this comment
# is even longer
# and wouldn't
# make sense to
# pack at the
# end of the
# command so it
# gets it's own
# lines
endif()
endif()
# This very long command should be broken up along keyword arguments
foo(nonkwarg_a nonkwarg_b
HEADERS a.h b.h c.h d.h e.h f.h
SOURCES a.cc b.cc d.cc
DEPENDS foo
bar baz)
# This command uses a string with escaped quote chars
foo(some_arg some_arg "This is a \"string\" within a string")
# This command uses an empty string
foo(some_arg some_arg "")
# This command uses a multiline string
foo(some_arg some_arg "
This string is on multiple lines
")
# No, I really want this to look ugly
# cmake-format: off
add_library(a b.cc
c.cc d.cc
e.cc)
# cmake-format: on
Restyles Dart, runs automatically.
Documentation
Configuration
restylers:
- dart-format:
arguments: []
command:
- dart
- format
image: restyled/restyler-dart-format:v2.3.4
include:
- '**/*.dart'
interpreters: []
Examples
Before
void example() {
if (tag=='style'||tag=='script'&&(type==null||type == TYPE_JS
||type==TYPE_DART)||
tag=='link'&&(rel=='stylesheet'||rel=='import')) {}
}
After
void example() {
if (tag == 'style' ||
tag == 'script' &&
(type == null || type == TYPE_JS || type == TYPE_DART) ||
tag == 'link' && (rel == 'stylesheet' || rel == 'import')) {}
}
Restyles D, runs automatically.
Documentation
Configuration
restylers:
- dfmt:
arguments: []
command:
- dfmt
- --inplace
image: restyled/restyler-dfmt:v0.14.2
include:
- '**/*.d'
interpreters: []
Examples
Before
void main(string[] args) {
bool optionOne, optionTwo, optionThree;
getopt(args,
"optionOne", &optionOne,
"optionTwo", &optionTwo,
"optionThree", &optionThree);
}
After
void main(string[] args)
{
bool optionOne, optionTwo, optionThree;
getopt(args, "optionOne", &optionOne, "optionTwo", &optionTwo, "optionThree", &optionThree);
}
Restyles Dhall, runs automatically.
Documentation
Configuration
restylers:
- dhall-format:
arguments:
- format
- --inplace
command:
- dhall
image: restyled/restyler-dhall-format:1.42.1
include:
- '**/*.dhall'
interpreters: []
Examples
Before
let Fruit_ = < Apple : {} | Banana : {} | Orange : {} >
in let fruiteHandler_ =
{ Apple = \(_ : {}) -> "Apple"
, Banana = \(_ : {}) -> "Banana"
, Orange = \(_ : {}) -> "Orange"
}
in let f = { Fruit = Fruit_, fruitToText = \(f : Fruit_) -> merge fruiteHandler_ f }
in let x = { fruit1 = f.fruitToText (f.Fruit.Apple {=}), fruit2 = f.fruitToText (f.Fruit.Banana {=}) }
in x // { fruit1 = f.fruitToText (f.Fruit.Orange {=}) }
After
let Fruit_ = < Apple : {} | Banana : {} | Orange : {} >
in let fruiteHandler_ =
{ Apple = \(_ : {}) -> "Apple"
, Banana = \(_ : {}) -> "Banana"
, Orange = \(_ : {}) -> "Orange"
}
in let f =
{ Fruit = Fruit_
, fruitToText = \(f : Fruit_) -> merge fruiteHandler_ f
}
in let x =
{ fruit1 = f.fruitToText (f.Fruit.Apple {=})
, fruit2 = f.fruitToText (f.Fruit.Banana {=})
}
in x // { fruit1 = f.fruitToText (f.Fruit.Orange {=}) }
Restyles C#, VB.NET, must be explicitly enabled.
Documentation
Configuration
restylers:
- dotnet-format:
arguments: []
command:
- dotnet-format-files
image: restyled/restyler-dotnet-format:v5.1.250801
include:
- '**/*.cs'
- '**/*.vb'
interpreters: []
Examples
Before
int formatted_code;
void unformatted_code ;
void formatted_code_again;
After
int formatted_code;
void unformatted_code;
void formatted_code_again;
Before
int formatted_code;
void unformatted_code ;
void formatted_code_again;
After
int formatted_code;
void unformatted_code;
void formatted_code_again;
Restyles Elm, runs automatically.
Documentation
Configuration
restylers:
- elm-format:
arguments: []
command:
- elm-format
- --yes
image: public.ecr.aws/restyled-io/restyler-elm-format:v0.6.1-alpha-3
include:
- '**/*.elm'
interpreters: []
Examples
Before
homeDirectory = "/root/files"
eval boolean = case boolean of
Literal bool -> bool
Not b -> not (eval b)
And b b_ -> eval b && eval b_
Or b b_ -> eval b || eval b_
After
module Main exposing (eval, homeDirectory)
homeDirectory =
"/root/files"
eval boolean =
case boolean of
Literal bool ->
bool
Not b ->
not (eval b)
And b b_ ->
eval b && eval b_
Or b b_ ->
eval b || eval b_
Restyles F#, runs automatically.
Documentation
Configuration
restylers:
- fantomas:
arguments: []
command:
- fantomas
image: restyled/restyler-fantomas:v3.3.0
include:
- '**/*.fs'
- '**/*.fsi'
- '**/*.fsx'
interpreters: []
Examples
Before
type Type
= TyLam of Type * Type
| TyVar of string
| TyCon of string * Type list
with override this.ToString () =
match this with
| TyLam (t1, t2) -> sprintf "(%s -> %s)" (t1.ToString()) (t2.ToString())
| TyVar a -> a
| TyCon (s, ts) -> s
After
type Type =
| TyLam of Type * Type
| TyVar of string
| TyCon of string * Type list
override this.ToString() =
match this with
| TyLam(t1, t2) -> sprintf "(%s -> %s)" (t1.ToString()) (t2.ToString())
| TyVar a -> a
| TyCon(s, ts) -> s
Before
let Multiple9x9 () =
for i in 1 .. 9 do
printf "\n";
for j in 1 .. 9 do
let k = i * j in
printf "%d x %d = %2d " i j k;
done;
done;;
Multiple9x9 ();;
After
let Multiple9x9() =
for i in 1 .. 9 do
printf "\n"
for j in 1 .. 9 do
let k = i * j
printf "%d x %d = %2d " i j k
Multiple9x9()
Restyles Haskell, must be explicitly enabled.
Configuration
restylers:
- fourmolu:
arguments: []
command:
- fourmolu
- --mode
- inplace
image: restyled/restyler-fourmolu:v0.16.2.0
include:
- '**/*.hs'
interpreters: []
Examples
Before
foo
:: MonadIO m
-> Text -> Text
-> SqlPersistT m ()
foo = undefined
After
foo ::
MonadIO m ->
Text ->
Text ->
SqlPersistT
m
()
foo = undefined
Restyles GN, runs automatically.
Configuration
restylers:
- gn:
arguments: []
command:
- gn
- format
image: restyled/restyler-gn:v2
include:
- '**/*.gn'
- '**/*.gni'
interpreters: []
Examples
Before
sources = ["b", "a"]
After
sources = [
"a",
"b",
]
Restyles Go, runs automatically.
Documentation
Configuration
restylers:
- gofmt:
arguments: []
command:
- gofmt
- -w
image: restyled/restyler-gofmt:go1.23.0
include:
- '**/*.go'
interpreters: []
Examples
Before
package main
import "fmt"
// this is demo to format code
// with gofmt command
var a int=2;
var b int=5;
var c string= `hello world`;
func print(){
fmt.Println("Value for a,b and c is : ");
fmt.Println(a);
fmt.Println((b));
fmt.Println(c);
}
After
package main
import "fmt"
// this is demo to format code
// with gofmt command
var a int = 2
var b int = 5
var c string = `hello world`
func print() {
fmt.Println("Value for a,b and c is : ")
fmt.Println(a)
fmt.Println((b))
fmt.Println(c)
}
Restyles Java, must be explicitly enabled.
Documentation
Configuration
restylers:
- google-java-format:
arguments: []
command:
- google-java-format
- --replace
image: public.ecr.aws/restyled-io/restyler-google-java-format:v1.9
include:
- '**/*.java'
interpreters: []
Examples
Before