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

Add formatting for Nunjucks files #3218

Merged
merged 112 commits into from
Jul 9, 2024
Merged

Conversation

rmccar
Copy link
Contributor

@rmccar rmccar commented May 24, 2024

What is the context of this PR?

Fixes: ONSdigital/design-team#58

Adds the Jinja plugin (prettier-plugin-jinja-template) to prettier and have then run prettier on all our Nunjucks files to format them correctly. I have also added them to the lint staging step so that they are formatted on the Husky pre commit hook. I have also fixed all errors and warnings from running prettier which has required some refactoring.

Some other fixes have gone in too:

  • Removed some component imports in some examples because those components weren't being used.
  • Removed the setting of the variants param on the related content component in some examples. This was having no effect because it's hardcoded to "bare" in the macro.

How to review this PR

  • Tests pass
  • Check through all files checking no unexpected changes have happened, this is the list of components that needed refactoring:
    • address-input
    • autosuggest
    • button
    • card
    • details
    • document-list
    • feedback
    • field
    • footer
    • header
    • input
    • label
    • language-selector
    • list
    • panel
    • section-navigation
    • share-page
    • summary
    • table
    • tabs
  • Check no breaking changes have been introduced

Checklist

This needs to be completed by the person raising the PR.

  • I have selected the correct Assignee
  • I have linked the correct Issue

@rmccar rmccar marked this pull request as draft May 24, 2024 21:11
@rmccar rmccar self-assigned this May 24, 2024
Copy link

netlify bot commented May 24, 2024

Deploy Preview for ons-design-system-preview ready!

Name Link
🔨 Latest commit bda325c
🔍 Latest deploy log https://app.netlify.com/sites/ons-design-system-preview/deploys/6686ae0afc77e90008793673
😎 Deploy Preview https://deploy-preview-3218--ons-design-system-preview.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.

@rmccar rmccar added the Tech improvements Tech debt, cleanup, code standardisation etc. label May 24, 2024
@rmccar rmccar marked this pull request as ready for review June 20, 2024 22:39
@rmccar rmccar marked this pull request as draft June 24, 2024 10:32
@rmccar rmccar marked this pull request as ready for review June 27, 2024 14:36
@rmccar rmccar requested a review from a team June 27, 2024 14:40
Copy link
Contributor

@alessioventuriniAND alessioventuriniAND left a comment

Choose a reason for hiding this comment

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

I can't find anything wrong. I have tested in locally and run the test command and all have passed. Considering the nmber of changes in the PR is there a way that you can point me in the direction of the components you had to manually change and reformat? I think you also mentioned that you had to rewrite some tests?

@rmccar
Copy link
Contributor Author

rmccar commented Jul 4, 2024

I can't find anything wrong. I have tested in locally and run the test command and all have passed. Considering the nmber of changes in the PR is there a way that you can point me in the direction of the components you had to manually change and reformat? I think you also mentioned that you had to rewrite some tests?

Ive added a list of components that needed refactoring to the description. I haven't touched any tests other than the html snapshot

@rmccar rmccar merged commit 0987fe7 into main Jul 9, 2024
10 checks passed
@rmccar rmccar deleted the add-formatting-for-nunjucks-files branch July 9, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tech improvements Tech debt, cleanup, code standardisation etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate the use of EditorConfig for developer settings and implement code standardisation in the DS
4 participants