Skip to content

Commit

Permalink
ci: implement lint job (#3)
Browse files Browse the repository at this point in the history
* ci: implement `lint` job

* chore: update lock file

* chore: nit

* chore: lint

* chore: nit
  • Loading branch information
leovct authored Nov 1, 2023
1 parent 6759634 commit 3a0a7a9
Show file tree
Hide file tree
Showing 7 changed files with 160 additions and 1 deletion.
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/
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
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"
}
}
89 changes: 89 additions & 0 deletions pnpm-lock.yaml

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

4 changes: 3 additions & 1 deletion src/TinyENS.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ contract TinyENS is ITinyENS {
return registry[name];
}

function reverse(address targetAddress) external view returns (string memory) {
function reverse(
address targetAddress
) external view returns (string memory) {
return reverseRegistry[targetAddress];
}
}

0 comments on commit 3a0a7a9

Please sign in to comment.