Skip to content

Commit

Permalink
chore: format codebase with Prettier
Browse files Browse the repository at this point in the history
Introduce a CI check that the codebase is properly formatted
  • Loading branch information
anton-trunov committed Apr 2, 2024
1 parent 716a93d commit b1c47db
Show file tree
Hide file tree
Showing 150 changed files with 10,740 additions and 6,530 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[*.{js,ts}]
indent_style = space
indent_size = 4

[{package.json, *.yml, .eslintrc.cjs}]
indent_style = space
indent_size = 2
27 changes: 14 additions & 13 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
/* eslint-env node */
module.exports = {
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
parser: '@typescript-eslint/parser',
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
parser: "@typescript-eslint/parser",
parserOptions: {
sourceType: "module",
ecmaVersion: 2020,
project: "./tsconfig.eslint.json",
},
ignorePatterns: ["*.cjs"],
plugins: ['@typescript-eslint'],
plugins: ["@typescript-eslint"],
root: true,
env: {
node: true,
es2021: true,
},
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-var-requires": ['error',
{
allow: ['/package\\.json$']
}
"@typescript-eslint/no-var-requires": [
"error",
{
allow: ["/package\\.json$"],
},
],
"@typescript-eslint/no-duplicate-type-constituents": "error",
},
Expand Down
10 changes: 5 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ IMPORTANT:
If your PR doesn't close a particular issue, please, create the issue first and describe the whole context: what you're adding/changing and why you're doing so. And only then open the Pull Request, which would close that issue!
-->

* [ ] I have updated CHANGELOG.md
* [ ] I have added unit tests to demonstrate the contribution is correctly implemented
* [ ] I have run all the tests locally and no test failure was reported
* [ ] I did not introduce unrelated formatting/whitespace changes in the code base
* [ ] I did not do unrelated and/or undiscussed refactorings
- [ ] I have updated CHANGELOG.md
- [ ] I have added unit tests to demonstrate the contribution is correctly implemented
- [ ] I have run all the tests locally and no test failure was reported
- [ ] I did not introduce unrelated formatting/whitespace changes in the code base
- [ ] I did not do unrelated and/or undiscussed refactorings
108 changes: 56 additions & 52 deletions .github/workflows/tact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Tact CI

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]
workflow_dispatch:

jobs:
Expand All @@ -14,63 +14,67 @@ jobs:
matrix:
node-version: [18.x]
os: [ubuntu-latest, windows-latest, macos-latest]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"

- name: Install dependencies
run: yarn install

- name: Build and Test Tact compiler
run: |
yarn clean
yarn gen
yarn build
yarn coverage
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Check there are no errors reported by ESLint
run: |
yarn lint
- name: Install dependencies
run: yarn install
- name: Check formatting with Prettier
run: |
yarn fmt:check
- name: Build and Test Tact compiler
run: |
yarn clean
yarn gen
yarn build
yarn coverage
- name: Check there are no errors reported by ESLint
run: |
yarn lint
- name: Check that tact.config.json adheres to the JSON schema
run: |
yarn lint:schema
- name: Check that tact.config.json adheres to the JSON schema
run: |
yarn lint:schema
- name: Compare Tact version from CLI flag `--version` against package.json
if: runner.os != 'Windows'
run: |
if [ "$(./bin/tact --version)" != "$(jq -r '.version' < package.json)" ];
then false
fi
- name: Compare Tact version from CLI flag `--version` against package.json
if: runner.os != 'Windows'
run: |
if [ "$(./bin/tact --version)" != "$(jq -r '.version' < package.json)" ];
then false
fi
- name: Link Tact compiler
run: |
yarn link
- name: Link Tact compiler
run: |
yarn link
- name: Test compatibility with tact-template
run: |
git clone https://github.com/tact-lang/tact-template.git
cd tact-template
yarn install
yarn link @tact-lang/compiler
yarn build
yarn test
yarn tact --version
- name: Test compatibility with tact-template
run: |
git clone https://github.com/tact-lang/tact-template.git
cd tact-template
yarn install
yarn link @tact-lang/compiler
yarn build
yarn test
yarn tact --version
- name: Test compatibility with Blueprint
run: |
yarn create ton -- test-project --type tact-counter --contractName Counter
cd test-project
yarn link @tact-lang/compiler
yarn build
yarn test
yarn tact --version
- name: Test compatibility with Blueprint
run: |
yarn create ton -- test-project --type tact-counter --contractName Counter
cd test-project
yarn link @tact-lang/compiler
yarn build
yarn test
yarn tact --version
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
dist

src/func/funcfiftlib.js
src/func/funcfiftlib.wasm.js
src/grammar/grammar.ohm-bundle.d.ts
src/grammar/grammar.ohm-bundle.js
src/imports/stdlib.ts
grammar
Loading

0 comments on commit b1c47db

Please sign in to comment.