Skip to content

Commit

Permalink
introduce clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
43081j committed Jul 31, 2019
1 parent 79c7fd3 commit dfed25a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
BasedOnStyle: Google
AlignAfterOpenBracket: AlwaysBreak
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
BinPackArguments: false
# This breaks async functions sometimes, see
# https://github.com/Polymer/polymer-analyzer/pull/393
# BinPackParameters: false
2 changes: 1 addition & 1 deletion .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ parserOptions:
ecmaVersion: 2017
sourceType: module
rules:
indent: [warn, 2]
indent: off
max-len: [warn, 120]
no-new: warn
quotes: [error, single, {"avoidEscape": true}]
Expand Down
19 changes: 19 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"clean:typescript": "npm run build:typescript -- --clean",
"clean:styles": "del-cli packages/*/src/*-css.ts",
"dev": "polyserve --npm --module-resolution=node",
"format": "clang-format --version; find packages | grep '\\.js$\\|\\.ts$' | xargs clang-format --style=file -i",
"lint:imports": "node scripts/check-imports.js",
"lint": "npm run lint:typescript",
"lint:typescript": "eslint \"packages/**/*.ts\"",
Expand Down Expand Up @@ -35,6 +36,7 @@
"babel-traverse": "^6.24.1",
"babylon": "^6.16.1",
"chai": "^4.2.0",
"clang-format": "^1.2.4",
"command-line-args": "^5.1.1",
"command-line-usage": "^5.0.5",
"del-cli": "^1.1.0",
Expand Down

1 comment on commit dfed25a

@mprobst
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI the BinPackParameters: false is no longer necessary, the related clang-format bug has been fixed a while ago.

Please sign in to comment.