Use internal clang format settings

Summary: Use internal linting rules instead of the custom once.

Differential Revision: D6284667

fbshipit-source-id: 65aae336f1d7f14dfefed7391b0f5b89b333495e
This commit is contained in:
Pritesh Nandgaonkar
2017-11-20 02:58:26 -08:00
committed by Facebook Github Bot
parent 26481a6553
commit 5b0dfa471f
3 changed files with 0 additions and 46 deletions

View File

@@ -25,9 +25,6 @@ Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe
disclosure of security bugs. In those cases, please go through the process
outlined on that page and do not file a public issue.
## Coding Style
* format.sh
## License
By contributing to yoga, you agree that your contributions will be licensed
under its BSD license.

View File

@@ -33,9 +33,6 @@ You may need to install the latest watir-webdriver gem (`gem install watir-webdr
### .NET
.NET testing is not integrated in buck yet, you might need to set up .NET testing environment. We have a script which to launch C# test on macOS, `csharp/tests/Facebook.Yoga/test_macos.sh`.
## Code style
For the main C implementation of Yoga clang-format is used to ensure a consistent code style. Please run `bash format.sh` before submitting a pull request. For other languages just try to follow the current code style.
## Benchmarks
Benchmarks are located in `benchmark/YGBenchmark.c` and can be run with `buck run //benchmark:benchmark`. If you think your change has affected performance please run this before and after your change to validate that nothing has regressed. Benchmarks are run on every commit in CI.
@@ -59,5 +56,3 @@ This will now only run the standalone webpack build upon install.
| node | Builds node js version. |
| standalone | Runs webpack. |
| none | Does nothing. You can use the prepackaged libs. |

View File

@@ -1,38 +0,0 @@
#!/usr/bin/env bash
BASEDIR="$(dirname "$0")"
FILES=$(find "$BASEDIR" \( -path "$BASEDIR/buck-out" -o -path "$BASEDIR/lib" \) -prune -o \
\( -name \*.h ! -name YGEnums.h -o -name \*.c -o -name \*.cpp \) -print)
for f in $FILES "$@"; do
clang-format \
-style="{ \
AlignAfterOpenBracket: Align, \
AlignEscapedNewlinesLeft: true, \
AlignOperands: true, \
AllowAllParametersOfDeclarationOnNextLine: false, \
AllowShortBlocksOnASingleLine: false, \
AllowShortCaseLabelsOnASingleLine: false, \
AllowShortFunctionsOnASingleLine: false, \
AllowShortIfStatementsOnASingleLine: false, \
AllowShortLoopsOnASingleLine: false, \
BinPackArguments: false, \
BinPackParameters: false, \
BreakBeforeBraces: Attach, \
ColumnLimit: 100, \
ContinuationIndentWidth: 4, \
IndentCaseLabels: true, \
IndentWidth: 2, \
KeepEmptyLinesAtTheStartOfBlocks: false, \
Language: Cpp, \
PenaltyBreakBeforeFirstCallParameter: 100, \
PenaltyBreakString: 1000, \
PenaltyExcessCharacter: 100, \
PenaltyReturnTypeOnItsOwnLine: 100, \
PointerAlignment: Right, \
SortIncludes: true, \
SpaceAfterCStyleCast: true, \
UseTab: Never, \
ObjCSpaceAfterProperty: true, \
}" -i "$f"
done