Closed LynnHerrick9 closed 1 year ago
Name | Link |
---|---|
Latest commit | 4bd88004ce239b0a62987124d3c8a5b49fc905b4 |
Latest deploy log | https://app.netlify.com/sites/bloom-guides-template/deploys/64a8787018eb53000802e786 |
Deploy Preview | https://deploy-preview-47--bloom-guides-template.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
This changes is related to the Setup Guides task. It adds linting functionality for nunjucks files. The linter can be run at any point during development. It is also added to the workflow process (from PR click checks tab in top-middle of screen, click Pull Request on left side of screen, click pr_checks on left-side or middle of screen, click Run Linter in middle of screen). Prior to this change the run linter option in PR Check was a print statement as a placeholder. The image below shows a screenshot of the workflow with djlint running and passing during the PR check of this current PR.
To make it more consumable for review, I will split up all the linter work into PRs associated to each linter and language. This review will include all changes for djlint and nunjucks code.
What was changed
How to check change
npm run serve
sh ./ci/linter.sh
. Below image shows an example of what the command line will look like when there are no errors.Example 1: In the below screenshot, I have removed the whitespace wrapping the variable
{{post.data.description}}
. Note the linter now reports an error for T001 with the message Variables should be wrapped in whitespace.Example 2: In the below screenshot, I have removed the opening
tag. Note the linter now reports an error for H025 with the message Tag seems to be an orphan.Notes
I have included the stdout used to make all nunjucks related changes for easier reviewing:
_includes/layouts/css.njk ─────────────────────────────────────────────────────────────────────────────── H025 2:0 Tag seems to be an orphan. H025 3:0 Tag seems to be an orphan.
_includes/layouts/footer.njk ─────────────────────────────────────────────────────────────────────────────── H006 36:10 Img tag should have height and width attributes. <img src="/img/bloom H006 41:10 Img tag should have height and width attributes. <img src="/img/sba.p
_includes/layouts/head.njk ─────────────────────────────────────────────────────────────────────────────── H025 2:0 Tag seems to be an orphan. <html lang="{{metada T001 2:12 Variables should be wrapped in a whitespace. {{metadata.language} H025 3:0 Tag seems to be an orphan.
_includes/layouts/post.njk ─────────────────────────────────────────────────────────────────────────────── T001 5:13 Variables should be wrapped in a whitespace. {{page.url}}
_includes/layouts/seo.njk ─────────────────────────────────────────────────────────────────────────────── T001 1:47 Variables should be wrapped in a whitespace. {{metadata.googlesit
_includes/postslist.njk ─────────────────────────────────────────────────────────────────────────────── T001 13:29 Variables should be wrapped in a whitespace. {{post.data.descript
Linted 22 files, found 10 errors.