-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/add-perltidy
- Loading branch information
Showing
26 changed files
with
479 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version=1.3.2 | ||
|
||
dest=$(mktemp -d) | ||
curl -L "https://github.com/klauspost/asmfmt/releases/download/v$version/asmfmt-Linux_x86_64_$version.tar.gz" | tar -xvzC "$dest" | ||
mv "$dest/asmfmt" /usr/local/bin/asmfmt | ||
rm -rf "$dest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
apt-get install -y astyle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
apt-get install -y python3-pip | ||
pip3 install beautysh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
version=6.0.1 | ||
curl -L --output /usr/local/bin/buildifier "https://github.com/bazelbuild/buildtools/releases/download/$version/buildifier-linux-amd64" && chmod +x /usr/local/bin/buildifier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
apt-get install -y python3-pip | ||
pip3 install cmakelang |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
apt-get install -y gawk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
apt-get install -y tidy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
apt-get install -y jq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Taken from https://files.klauspost.com/diff.html | ||
|
||
#include "zasm_GOOS_GOARCH.h" | ||
#include "funcdata.h" | ||
#include "textflag.h" | ||
|
||
TEXT runtime·rt0_go(SB),NOSPLIT,$0 | ||
// copy arguments forward on an even stack | ||
MOVQ DI, AX // argc | ||
MOVQ SI, BX // argv | ||
SUBQ $(4*8+7), SP // 2args 2auto | ||
ANDQ $~15, SP | ||
MOVQ AX, 16(SP) | ||
MOVQ BX, 24(SP) | ||
// create istack out of the given (operating system) stack. | ||
// _cgo_init may update stackguard. | ||
MOVQ $runtime·g0(SB), DI | ||
LEAQ (-64*1024+104)(SP), BX | ||
MOVQ BX, g_stackguard0(DI) | ||
MOVQ BX, g_stackguard1(DI) | ||
MOVQ BX, (g_stack+stack_lo)(DI) | ||
MOVQ SP, (g_stack+stack_hi)(DI) | ||
|
||
// find out information about the processor we're on | ||
MOVQ $0, AX | ||
CPUID | ||
CMPQ AX, $0 | ||
JE nocpuinfo | ||
MOVQ $1, AX | ||
CPUID | ||
MOVL CX, runtime·cpuid_ecx(SB) | ||
MOVL DX, runtime·cpuid_edx(SB) | ||
nocpuinfo: | ||
// if there is an _cgo_init, call it. | ||
MOVQ _cgo_init(SB), AX | ||
TESTQ AX, AX | ||
JZ needtls | ||
// g0 already in DI | ||
MOVQ DI, CX // Win64 uses CX for first parameter | ||
MOVQ $setg_gcc<>(SB), SI | ||
CALL AX | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Taken from https: // files.klauspost.com/diff.html | ||
|
||
#include "zasm_GOOS_GOARCH.h" | ||
#include "funcdata.h" | ||
#include "textflag.h" | ||
|
||
TEXT runtime·rt0_go(SB), NOSPLIT, $0 | ||
// copy arguments forward on an even stack | ||
MOVQ DI, AX // argc | ||
MOVQ SI, BX // argv | ||
SUBQ $(4*8+7), SP // 2args 2auto | ||
ANDQ $~15, SP | ||
MOVQ AX, 16(SP) | ||
MOVQ BX, 24(SP) | ||
|
||
// create istack out of the given (operating system) stack. | ||
// _cgo_init may update stackguard. | ||
MOVQ $runtime·g0(SB), DI | ||
LEAQ (-64*1024+104)(SP), BX | ||
MOVQ BX, g_stackguard0(DI) | ||
MOVQ BX, g_stackguard1(DI) | ||
MOVQ BX, (g_stack+stack_lo)(DI) | ||
MOVQ SP, (g_stack+stack_hi)(DI) | ||
|
||
// find out information about the processor we're on | ||
MOVQ $0, AX | ||
CPUID | ||
CMPQ AX, $0 | ||
JE nocpuinfo | ||
MOVQ $1, AX | ||
CPUID | ||
MOVL CX, runtime·cpuid_ecx(SB) | ||
MOVL DX, runtime·cpuid_edx(SB) | ||
|
||
nocpuinfo: | ||
|
||
// if there is an _cgo_init, call it. | ||
MOVQ _cgo_init(SB), AX | ||
TESTQ AX, AX | ||
JZ needtls | ||
|
||
// g0 already in DI | ||
MOVQ DI, CX // Win64 uses CX for first parameter | ||
MOVQ $setg_gcc<>(SB), SI | ||
CALL AX | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../clang-format/in.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// https://www.ioccc.org/2020/burton/prog.c | ||
int main(int b,char**i) { | ||
long long n=B,a=I^n,r=(a/b&a)>>4,y=atoi(*++i),_=(((a^n/b)*(y>>T)|y>>S)&r)|(a^r); | ||
printf("%.8s\n",(char*)&_); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../shfmt/in.bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
function f(){ | ||
thing;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library");cc_library( | ||
name="hello-greet", | ||
srcs=["hello-greet.cc"], | ||
hdrs=["hello-greet.h"]);cc_binary(name="hello-world", srcs=["hello-world.cc"], deps=[":hello-greet", "//lib:hello-time"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") | ||
|
||
cc_library( | ||
name = "hello-greet", | ||
srcs = ["hello-greet.cc"], | ||
hdrs = ["hello-greet.h"], | ||
) | ||
cc_binary(name = "hello-world", srcs = ["hello-world.cc"], deps = [":hello-greet", "//lib:hello-time"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# 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 | ||
|
||
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 |
Oops, something went wrong.