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

Restyle All restylers test cases #50

Open
wants to merge 53 commits into
base: testing/all
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
4184b98
Restyled by astyle
restyled-commits Jul 24, 2024
1e15b97
Restyled by autopep8
restyled-commits Jul 24, 2024
158bb8a
Restyled by black
restyled-commits Jul 24, 2024
5d424f7
Restyled by brittany
restyled-commits Jul 24, 2024
2b4d5e9
Restyled by cabal-fmt
restyled-commits Jul 24, 2024
ca35e57
Restyled by clang-format
restyled-commits Jul 24, 2024
264337d
Restyled by cmake-format
restyled-commits Jul 24, 2024
01d3ad3
Restyled by dart-format
restyled-commits Jul 24, 2024
3d1f9eb
Restyled by dfmt
restyled-commits Jul 24, 2024
634af5e
Restyled by dhall-format
restyled-commits Jul 24, 2024
85b400d
Restyled by dotnet-format
restyled-commits Jul 24, 2024
a497bee
Restyled by elm-format
restyled-commits Jul 24, 2024
69f11aa
Restyled by fantomas
restyled-commits Jul 24, 2024
f5311b3
Restyled by fourmolu
restyled-commits Jul 24, 2024
c5032b9
Restyled by gn
restyled-commits Jul 24, 2024
53699d0
Restyled by gofmt
restyled-commits Jul 24, 2024
0d6856f
Restyled by google-java-format
restyled-commits Jul 24, 2024
6bf61ef
Restyled by hindent
restyled-commits Jul 24, 2024
956d663
Restyled by hlint
restyled-commits Jul 24, 2024
3c0e2dd
Restyled by isort
restyled-commits Jul 24, 2024
86869d1
Restyled by jdt
restyled-commits Jul 24, 2024
b4d4e7a
Restyled by jq
restyled-commits Jul 24, 2024
ba5a995
Restyled by luaformatter
restyled-commits Jul 24, 2024
eabcfae
Restyled by nixpkgs-fmt
restyled-commits Jul 24, 2024
5e9595c
Restyled by npm-groovy-lint
restyled-commits Jul 24, 2024
4a1feaa
Restyled by ocamlformat
restyled-commits Jul 24, 2024
c79fea2
Restyled by ormolu
restyled-commits Jul 24, 2024
1102991
Restyled by perltidy
restyled-commits Jul 24, 2024
b238470
Restyled by pg_format
restyled-commits Jul 24, 2024
da19cfc
Restyled by php-cs-fixer
restyled-commits Jul 24, 2024
c73c036
Restyled by prettier-ruby
restyled-commits Jul 24, 2024
62d3373
Restyled by prettier
restyled-commits Jul 24, 2024
46f6131
Restyled by prettier-json
restyled-commits Jul 24, 2024
f8fcddc
Restyled by prettier-markdown
restyled-commits Jul 24, 2024
2319501
Restyled by prettier-yaml
restyled-commits Jul 24, 2024
565e649
Restyled by purty
restyled-commits Jul 24, 2024
e29ca33
Restyled by pyment
restyled-commits Jul 24, 2024
60326e9
Restyled by refmt
restyled-commits Jul 24, 2024
077e1b4
Restyled by reorder-python-imports
restyled-commits Jul 24, 2024
03fda67
Restyled by rubocop
restyled-commits Jul 24, 2024
2e52454
Restyled by rustfmt
restyled-commits Jul 24, 2024
e639b0f
Restyled by scalafmt
restyled-commits Jul 24, 2024
2eed415
Restyled by shellcheck
restyled-commits Jul 24, 2024
2938335
Restyled by shellharden
restyled-commits Jul 24, 2024
d581624
Restyled by shfmt
restyled-commits Jul 24, 2024
dcabcc3
Restyled by sqlformat
restyled-commits Jul 24, 2024
a8455b1
Restyled by standardrb
restyled-commits Jul 24, 2024
ca1f2c2
Restyled by stylish-haskell
restyled-commits Jul 24, 2024
1262dd2
Restyled by taplo
restyled-commits Jul 24, 2024
a7bc066
Restyled by terraform
restyled-commits Jul 24, 2024
f26ac2c
Restyled by verible
restyled-commits Jul 24, 2024
d44ac09
Restyled by whitespace
restyled-commits Jul 24, 2024
17b0145
Restyled by yapf
restyled-commits Jul 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions astyle-test-0.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
int Foo(bool isBar)
{
{
if (isBar) {
bar();
return 1; }
return 1;
}
else
return 0;
}
24 changes: 12 additions & 12 deletions astyle-test-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
#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;
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;
}
17 changes: 10 additions & 7 deletions autopep8-test-0.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import math, sys;
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]}}
# 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)
25 changes: 19 additions & 6 deletions black-test-0.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
import math, sys;
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]}}
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)
4 changes: 2 additions & 2 deletions brittany-test-0.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
func (MyLongFoo abc def) = 1
func (Bar a d) = 2
func _ = 3
func (Bar a d ) = 2
func _ = 3
34 changes: 22 additions & 12 deletions cabal-fmt-test-0.cabal
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
cabal-version: 2.4
name: cabal-fmt
version: 0
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
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
2 changes: 1 addition & 1 deletion clang-format-test-0.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
int formatted_code;
void unformatted_code ;
void unformatted_code;
void formatted_code_again;
102 changes: 59 additions & 43 deletions cmake-format-test-0..cmake-format-test
Original file line number Diff line number Diff line change
@@ -1,84 +1,100 @@
# 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 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 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)
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")
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.")
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")
# 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.
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...
# 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
# 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
# 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
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()
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)
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")
Expand Down
7 changes: 4 additions & 3 deletions dart-format-test-0.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
void example() {
if (tag=='style'||tag=='script'&&(type==null||type == TYPE_JS
||type==TYPE_DART)||
tag=='link'&&(rel=='stylesheet'||rel=='import')) {}
if (tag == 'style' ||
tag == 'script' &&
(type == null || type == TYPE_JS || type == TYPE_DART) ||
tag == 'link' && (rel == 'stylesheet' || rel == 'import')) {}
}
8 changes: 3 additions & 5 deletions dfmt-test-0.d
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
void main(string[] args) {
void main(string[] args)
{
bool optionOne, optionTwo, optionThree;
getopt(args,
"optionOne", &optionOne,
"optionTwo", &optionTwo,
"optionThree", &optionThree);
getopt(args, "optionOne", &optionOne, "optionTwo", &optionTwo, "optionThree", &optionThree);
}
26 changes: 18 additions & 8 deletions dhall-format-test-0.dhall
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
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 {=}) }

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 {=}) }
2 changes: 1 addition & 1 deletion dotnet-format-test-0.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
int formatted_code;
void unformatted_code ;
void unformatted_code;
void formatted_code_again;
2 changes: 1 addition & 1 deletion dotnet-format-test-1.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
int formatted_code;
void unformatted_code ;
void unformatted_code;
void formatted_code_again;
26 changes: 20 additions & 6 deletions elm-format-test-0.elm
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
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_
module Main exposing (..)


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_
14 changes: 7 additions & 7 deletions fantomas-test-0.fs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
type Type
= TyLam of Type * Type
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
override this.ToString() =
match this with
| TyLam(t1, t2) -> sprintf "(%s -> %s)" (t1.ToString()) (t2.ToString())
| TyVar a -> a
| TyCon(s, ts) -> s
Loading