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

Formatting #1208

Closed
wants to merge 27 commits into from
Closed

Formatting #1208

wants to merge 27 commits into from

Conversation

goosewobbler
Copy link
Contributor

@goosewobbler goosewobbler commented Nov 30, 2022

Using prettier, lint-staged and husky to remove formatting nits from all PRs going forward. This does not include linting, saving that for another PR.

Prettier options: https://prettier.io/docs/en/options.html

Changes

  • lint-staged runs on husky pre-commit, which runs the format script, which runs prettier on TS, JS, MD, YML, JSON files.
  • formatting can be run and checked manually with npm run format and npm run format:check
  • unit tests run on husky pre-push - so no more PRs with broken tests, and zero tolerance for flaky tests

Prettier settings

See .prettierrc.json

In-editor formatting

Prettier VSCode formatter - not required for development but I usually have this configured to format on save:
https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode

TODO:

  • update package-lock.json
  • make hook files executable
  • ensure hooks work
  • deflake tests - if necessary: 2166fd6 (#913)

floating and others added 9 commits November 29, 2022 16:57
* removing critical deps

* remove redundant deps, get rid of critical warnings

* remove formatEther import

* address matts comments
Co-authored-by: goosewobbler <goosewobbler@pm.me>
Co-authored-by: goosewobbler <goosewobbler@pm.me>
Co-authored-by: goosewobbler <432005+goosewobbler@users.noreply.github.com>
Co-authored-by: Jamie M <jamie.michel@hotmail.com>
Co-authored-by: Jamie M <54599757+Jamchello@users.noreply.github.com>
Co-authored-by: goosewobbler <goosewobbler@pm.me>
Co-authored-by: Matt Holtzman <matt.holtzman@gmail.com>
@goosewobbler goosewobbler changed the title base config and package updates Formatting Nov 30, 2022
@goosewobbler goosewobbler mentioned this pull request Nov 30, 2022
5 tasks
@goosewobbler goosewobbler added WIP PRs that are still in progress and not ready for review or merging tooling blocked labels Nov 30, 2022
@goosewobbler goosewobbler removed WIP PRs that are still in progress and not ready for review or merging blocked labels Dec 1, 2022
.prettierignore Outdated Show resolved Hide resolved
"/node_modules/",
"<rootDir>/test/main/signers/ledger/adapter"
],
"roots": ["test"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wyt about excluding these types of files (perhaps .config.json) or some such? I kind of like the readability of the previous style, especially for configuration files where compacting things into one line isn't really important

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm honestly more inclined to let Prettier do its thing everywhere - managing exemptions would be more work

@@ -4,6 +4,7 @@
"description": "System-wide web3",
"main": "compiled/main",
"scripts": {
"prepare": "husky install",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed this in the husky setup docs but does this need to be run every time a new repo is checked out or just once and then we have the husky hooks checked into source control?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing every time, otherwise it wouldn't exist?

@floating floating changed the base branch from deps to develop December 1, 2022 16:32
@goosewobbler
Copy link
Contributor Author

Closing in favour of #1211

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants