Skip to content

Commit

Permalink
Prettier tooling (#707)
Browse files Browse the repository at this point in the history
* #671: configured prettier for new developers  (#683)

* #671: configured prettier

* Removed the pre-hook commit section and also minimized the Readme.md file

* also added test:lint or test:format script in package.json which can be run locally or in CI

* Delete ci.yaml

* Updated changes

* Update pnpm-lock.yaml

Resolved conflicts

* Update pnpm-lock.yaml

* Update package.json

* Update pnpm-lock.yaml

* Update pnpm-lock.yaml

* changed the versions for consistency

* fix lockfile

* sort deps

* update prettier commands

* add formatting check to CI

* add formatting error

* fix yaml

* run pnpm format

---------

Co-authored-by: Atreyee <[email protected]>
  • Loading branch information
josephjclark and River-unknown authored Jun 3, 2024
1 parent ae72486 commit 281417a
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 101 deletions.
14 changes: 14 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,17 @@ jobs:
name: Run Tests
command: pnpm test

format:
docker:
- image: cimg/node:18.18
resource_class: medium
steps:
- attach_workspace:
at: ~/project
- run:
name: Check formatting
command: pnpm test:format

type_check:
docker:
- image: cimg/node:18.18
Expand Down Expand Up @@ -109,6 +120,9 @@ workflows:
- type_check:
requires:
- build
- format:
requires:
- build
- integration_test:
requires:
- build
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,19 @@ pnpm export adaptor-docs

This will build adaptor-docs into a tarball and install it directly into Lightning (assuming that `Lightning` is a sibling dir of `kit`).

## Documentation
## Code Formatting with Prettier

For information on the history of the OpenFn internals and ideas for the future
see [docs/future](docs/future).
[Prettier](https://prettier.io/) ensures consistent code style throughout the project.

### Editor Integration

Install the Prettier extension for your code editor to enable automatic formatting on save:

- **Visual Studio Code**: Install the "Prettier - Code formatter" extension.

### Manual Formatting

You can manually format files using Prettier by running:

```bash
pnpm run format
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
"clean:local": "rimraf dist/**/*",
"clean": "rimraf packages/*/dist",
"export": "sh scripts/export.sh",
"format": "prettier --write packages/*/src",
"generate-slack-report": "node ./scripts/slack-publish-message.js",
"install:global": "pnpm build && pnpm run pack && node ./build/install-global.js",
"install:openfnx": "pnpm install:global",
"pack:local": "pnpm run pack && node ./build/pack-local.js",
"pack": "pnpm -r run pack",
"setup": "rm -rf node_modules && rm -rf ./packages/*/node_modules && pnpm i",
"test:format": "prettier --check packages/*/src",
"test:integration": "pnpm -r --filter=./integration-tests/* run test",
"test:types": "pnpm -r --filter=./packages/* run test:types",
"test": "pnpm -r --filter=./packages/* run test",
Expand All @@ -29,6 +31,7 @@
"@types/rimraf": "^3.0.2",
"@types/tar-stream": "^2.2.2",
"gunzip-maybe": "^1.4.2",
"prettier": "^2.8.8",
"rimraf": "^3.0.2",
"tar-stream": "^3.0.0",
"typesync": "^0.11.1"
Expand Down
113 changes: 15 additions & 98 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 281417a

Please sign in to comment.