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

chore: fix prettier, move pages, add husky #14

Merged
merged 8 commits into from
Jul 9, 2024
Merged

Conversation

isabellabrookes
Copy link
Collaborator

@isabellabrookes isabellabrookes commented Jul 3, 2024

  • Added husky for pre-commit hooks
  • Updated documentation
  • Moved pages to their own subdir _pages/ to clean up root
  • Ran prettier on all files
  • Added GHA for formatting via prettier on pull-request

Copy link

netlify bot commented Jul 3, 2024

Deploy Preview for twc-site-nl ready!

Name Link
🔨 Latest commit 1f30423
🔍 Latest deploy log https://app.netlify.com/sites/twc-site-nl/deploys/668d154da63cab0008c639d7
😎 Deploy Preview https://deploy-preview-14--twc-site-nl.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@isabellabrookes isabellabrookes marked this pull request as ready for review July 3, 2024 12:20
@thisislawatts
Copy link
Contributor

Praise: Thanks for introducing Prettier @isabellabrookes that is a really positive change ✨

Suggestion (non-blocking): Perhaps it would be worth adopting a GitHub action to lint the changes to avoid regressions being introduced by folks who opt of git hooks

@b-n
Copy link
Collaborator

b-n commented Jul 8, 2024

@isabellabrookes do you feel strongly about precommit hooks? I have a preference for merge checks vs. precommit.

Happy to describe the reasons why, but shortcutting the conversation by asking the question first.

I'm happy to make/push a Github Action for prettier as a pre merge check since I'm asking for the alternative.

@isabellabrookes
Copy link
Collaborator Author

isabellabrookes commented Jul 8, 2024

@thisislawatts & @b-n I initially had a GHA, but then I dropped it because I thought I was adding too much.

Techincally, the githook is optional. You don't have to run npm install at all. Especially if you have prettier installed globally.

Options:

  1. remove pre-commit hook + add gha
  2. keep pre-commit hook, redefine the docs to make it optional + add alternative for global prettier
  3. number 2 + gha

@b-n
Copy link
Collaborator

b-n commented Jul 8, 2024

@isabellabrookes Opt 3 has my preference. LMK if I can help with anything, and much appreciation for this work!

Copy link
Collaborator

@b-n b-n left a comment

Choose a reason for hiding this comment

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

Whilst here I thought I'd check file by file (otherwise I'm a hypocrit at work 😅).

"Request changes" per the GHA discussion.

There is a question around events.[yaml|json] I have 🤔

The other comments are mostly just so I remember to make issues. Found this along the way: https://github.com/adamzapasnik/prettier-plugin-erb (for a new PR though)

_includes/events.html Outdated Show resolved Hide resolved
_includes/head.html Outdated Show resolved Hide resolved
_includes/main.js Show resolved Hide resolved
_layouts/translated.html Outdated Show resolved Hide resolved
docker-compose.yml Show resolved Hide resolved
docs/contributing.md Outdated Show resolved Hide resolved
@@ -1,12 +0,0 @@
---
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hrmmmm. Site still works without this?

There is an admin page here: https://techwerkers.nl/admin/ and I'm wondering if this file is needed there,

Copy link
Collaborator Author

@isabellabrookes isabellabrookes Jul 8, 2024

Choose a reason for hiding this comment

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

Honestly, I yolo-ed. It didn't break my the docker env. I don't have access to netlify, so I'm not sure it's something I can check. Can we use the preview: https://deploy-preview-14--twc-site-nl.netlify.app/admin ?

@@ -1,12 +0,0 @@
---
Copy link
Collaborator

Choose a reason for hiding this comment

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

As previous comment too

@isabellabrookes isabellabrookes force-pushed the chore/clean-up branch 5 times, most recently from b76c277 to 7a7d958 Compare July 8, 2024 22:32
@isabellabrookes isabellabrookes force-pushed the chore/clean-up branch 7 times, most recently from 5e49940 to df64daa Compare July 8, 2024 23:13
@isabellabrookes
Copy link
Collaborator Author

isabellabrookes commented Jul 8, 2024

@b-n & @thisislawatts

  1. fixed the erb liquid issue
  2. updated the docs with all the options for pre-commit hooks/prettier - here
  3. added a GHA that runs prettier, and commits any changes for you. Tested successfully here - (2261c9a)
  4. As for the events.json/yml - I have no clue as I can't access netlify. I can put them back easily enough

@isabellabrookes isabellabrookes force-pushed the chore/clean-up branch 3 times, most recently from 81ea76a to 5f30288 Compare July 8, 2024 23:28
@isabellabrookes isabellabrookes force-pushed the chore/clean-up branch 2 times, most recently from 48f6038 to 4b7aac2 Compare July 8, 2024 23:32
Copy link
Collaborator

@b-n b-n left a comment

Choose a reason for hiding this comment

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

One last little bit to discuss with the action. The rest of the changes are ✅

.github/workflows/pull-request.yaml Outdated Show resolved Hide resolved
.github/workflows/pull-request.yaml Outdated Show resolved Hide resolved
@isabellabrookes isabellabrookes requested a review from b-n July 9, 2024 10:47
@b-n
Copy link
Collaborator

b-n commented Jul 9, 2024

:shipit:

@isabellabrookes isabellabrookes merged commit faaf353 into main Jul 9, 2024
5 checks passed
@b-n b-n deleted the chore/clean-up branch October 9, 2024 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants