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

Prettier tooling #707

Merged
merged 8 commits into from
Jun 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
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.