diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..a8aa7c9 --- /dev/null +++ b/.clang-format @@ -0,0 +1,22 @@ +BasedOnStyle: LLVM +IndentWidth: 2 +UseTab: Never +ColumnLimit: 0 +BinPackArguments: false +BinPackParameters: false +AllowAllArgumentsOnNextLine: false +AllowAllParametersOfDeclarationOnNextLine: false +AlwaysBreakAfterReturnType: None +PenaltyBreakAssignment: 100000000 +PenaltyBreakBeforeFirstCallParameter: 100000000 +PenaltyBreakComment: 100000000 +PenaltyBreakFirstLessLess: 100000000 +PenaltyBreakString: 100000000 +PenaltyExcessCharacter: 100000000 +PenaltyReturnTypeOnItsOwnLine: 100000000 +PenaltyIndentedWhitespace: 100000000 +ContinuationIndentWidth: 2 +AlignAfterOpenBracket: DontAlign +AlignOperands: false +BreakBeforeBinaryOperators: None +BreakBeforeTernaryOperators: false diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b554d70..a2c0796 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,6 +3,18 @@ name: Test on: [push] jobs: + style: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/setup-node@v2 + - name: Code Style Check + run: npx -y prettier -c . + # run: npx @biomejs/biome format . # do this after we move to biome config + build: strategy: fail-fast: false @@ -68,4 +80,4 @@ jobs: path: ./node_modules key: modules-${{ hashFiles('package-lock.json') }} - name: Build for arm - run: docker run --platform linux/arm --rm -v "${PWD}:/work" -w /work node ./tools/crossbuild-drm.sh \ No newline at end of file + run: docker run --platform linux/arm --rm -v "${PWD}:/work" -w /work node ./tools/crossbuild-drm.sh diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..46f2aeb --- /dev/null +++ b/.prettierrc @@ -0,0 +1,21 @@ +{ + "arrowParens": "always", + "bracketSameLine": false, + "bracketSpacing": true, + "embeddedLanguageFormatting": "auto", + "endOfLine": "lf", + "htmlWhitespaceSensitivity": "css", + "insertPragma": false, + "jsxSingleQuote": true, + "printWidth": 9999, + "proseWrap": "preserve", + "quoteProps": "as-needed", + "requirePragma": false, + "semi": false, + "singleAttributePerLine": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false, + "vueIndentScriptAndStyle": false +} diff --git a/README.md b/README.md index c9cb607..37064de 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![node-raylib Logo](logo/raylib-node_256x256.png) -# node-raylib [![npm version](http://img.shields.io/npm/v/raylib.svg)](https://npmjs.org/package/raylib "View this project on npm") [![Tests](https://github.com/RobLoach/node-raylib/workflows/Tests/badge.svg)](https://github.com/RobLoach/node-raylib/actions?query=workflow%3ATests+branch%3Amaster "See automated test status on GitHub Actions") +# node-raylib [![npm version](http://img.shields.io/npm/v/raylib.svg)](https://npmjs.org/package/raylib "View this project on npm") [![Tests](https://github.com/RobLoach/node-raylib/actions/workflows/test.yml/badge.svg)](https://github.com/RobLoach/node-raylib/actions/workflows/test.yml "See automated test status on GitHub Actions") [Node.js](https://nodejs.org) bindings for [raylib](https://www.raylib.com/), a simple and easy-to-use library to enjoy videogames programming (www.raylib.com).