Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: format codebase with Prettier #227

Merged
merged 8 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* text=auto eol=lf
*.html linguist-vendored

9 changes: 4 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ 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 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
novusnota marked this conversation as resolved.
Show resolved Hide resolved
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
Loading