Skip to content

Commit

Permalink
ci: implement lint job
Browse files Browse the repository at this point in the history
  • Loading branch information
leovct committed Nov 1, 2023
1 parent 6759634 commit 828c144
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: lint

on: push

env:
PNPM_VERSION: 8
NODE_VERSION: 20.9

jobs:
check:
strategy:
fail-fast: true

name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION }}

- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install
id: install

- name: Run linter
run: pnpm run check
id: lint
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ docs/

# Dotenv file
.env

# Dependencies
node_modules/
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cache/
lib/
node_modules/
out/
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# .prettierrc or .prettierrc.yaml
trailingComma: 'es5'
tabWidth: 2
semi: false
singleQuote: true
21 changes: 21 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "tiny-web3",
"version": "1.0.0",
"description": "Tiny web3 protocols and applications.",
"main": "index.js",
"directories": {
"lib": "lib",
"test": "test"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"check": "pnpm exec prettier --plugin prettier-plugin-solidity --check .",
"lint": "pnpm exec prettier --plugin prettier-plugin-solidity --write ."
},
"author": "",
"license": "ISC",
"devDependencies": {
"prettier": "^3.0.3",
"prettier-plugin-solidity": "^1.1.3"
}
}
85 changes: 85 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit 828c144

Please sign in to comment.