From df9fe4d5a453fa6aa8ce840d826228621fa864b1 Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Sun, 10 Sep 2023 10:30:50 +0000 Subject: [PATCH] chore: add prettier --- .eleventy.js | 44 +++++++++++++++--------------- .github/workflows/github-pages.yml | 4 +-- .prettierignore | 1 + .prettierrc.json | 1 + package-lock.json | 18 +++++++++++- package.json | 3 +- src/data/meta.json | 6 ++-- src/data/packageVersions.json | 14 ++++------ src/data/packages.json | 6 +--- src/views/index.11tydata.js | 6 ++-- src/views/package.11tydata.js | 22 +++++++-------- src/views/views.11tydata.js | 8 +++--- 12 files changed, 73 insertions(+), 60 deletions(-) create mode 100644 .prettierignore create mode 100644 .prettierrc.json diff --git a/.eleventy.js b/.eleventy.js index 0fd70b6..84826f3 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,26 +1,26 @@ const htmlmin = require("html-minifier"); -module.exports = function(eleventyConfig) { - eleventyConfig.addTransform("htmlmin", function(content, outputPath) { - if (outputPath.endsWith(".html")) { - let minified = htmlmin.minify(content, { - useShortDocType: true, - removeComments: true, - collapseWhitespace: true, - }) +module.exports = function (eleventyConfig) { + eleventyConfig.addTransform("htmlmin", function (content, outputPath) { + if (outputPath.endsWith(".html")) { + let minified = htmlmin.minify(content, { + useShortDocType: true, + removeComments: true, + collapseWhitespace: true, + }); - return minified; - } - }) - - return { - dir: { - input: 'src', - output: 'dist', - includes: 'includes', - layouts: 'layouts', - data: 'data', - }, - dataTemplateEngine: 'njk', + return minified; } -} \ No newline at end of file + }); + + return { + dir: { + input: "src", + output: "dist", + includes: "includes", + layouts: "layouts", + data: "data", + }, + dataTemplateEngine: "njk", + }; +}; diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index be2a21c..822ce62 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -25,11 +25,11 @@ jobs: npm run build:prod - uses: actions/upload-pages-artifact@v2 with: - path: 'dist' + path: "dist" deploy: runs-on: ubuntu-latest needs: build steps: - id: deployment - uses: actions/deploy-pages@v2 \ No newline at end of file + uses: actions/deploy-pages@v2 diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..53c37a1 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +dist \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1 @@ +{} diff --git a/package-lock.json b/package-lock.json index 4150a5a..d67158a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,8 @@ "license": "ISC", "devDependencies": { "@11ty/eleventy": "^2.0.1", - "html-minifier": "^4.0.0" + "html-minifier": "^4.0.0", + "prettier": "3.0.3" } }, "node_modules/@11ty/dependency-tree": { @@ -1892,6 +1893,21 @@ "node": ">= 4" } }, + "node_modules/prettier": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", + "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/promise": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", diff --git a/package.json b/package.json index b7e4edb..a7e8c24 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "license": "ISC", "devDependencies": { "@11ty/eleventy": "^2.0.1", - "html-minifier": "^4.0.0" + "html-minifier": "^4.0.0", + "prettier": "3.0.3" } } diff --git a/src/data/meta.json b/src/data/meta.json index 6418c42..48ba4a8 100644 --- a/src/data/meta.json +++ b/src/data/meta.json @@ -1,4 +1,4 @@ { - "githubReleaseRepo": "https://github.com/python-LimeReport/pyside", - "baseURL": "/pypi" -} \ No newline at end of file + "githubReleaseRepo": "https://github.com/python-LimeReport/pyside", + "baseURL": "/pypi" +} diff --git a/src/data/packageVersions.json b/src/data/packageVersions.json index c5fc2d6..ffe7711 100644 --- a/src/data/packageVersions.json +++ b/src/data/packageVersions.json @@ -1,9 +1,7 @@ [ - { - "tag": "py3.9-qt6.4.2", - "suffixes": [ - "-6.4.2-6.4.2-cp37-abi3-manylinux_2_28_x86_64" - ], - "requires_python": "<3.12,>=3.7" - } -] \ No newline at end of file + { + "tag": "py3.9-qt6.4.2", + "suffixes": ["-6.4.2-6.4.2-cp37-abi3-manylinux_2_28_x86_64"], + "requires_python": "<3.12,>=3.7" + } +] diff --git a/src/data/packages.json b/src/data/packages.json index f4fcf81..cee5aa4 100644 --- a/src/data/packages.json +++ b/src/data/packages.json @@ -1,5 +1 @@ -[ - "pyside6", - "shiboken6", - "shiboken6-generator" -] \ No newline at end of file +["pyside6", "shiboken6", "shiboken6-generator"] diff --git a/src/views/index.11tydata.js b/src/views/index.11tydata.js index 5fc651d..651474d 100644 --- a/src/views/index.11tydata.js +++ b/src/views/index.11tydata.js @@ -1,4 +1,4 @@ module.exports = { - layout: 'base.njk', - permalink: '/', -} \ No newline at end of file + layout: "base.njk", + permalink: "/", +}; diff --git a/src/views/package.11tydata.js b/src/views/package.11tydata.js index cebd459..e781181 100644 --- a/src/views/package.11tydata.js +++ b/src/views/package.11tydata.js @@ -1,13 +1,13 @@ module.exports = { - layout: 'base.njk', - - pagination: { - data: 'packages', - size: 1, - alias: 'package' - }, + layout: "base.njk", - permalink: function (data) { - return data.package + "/" - }, -} \ No newline at end of file + pagination: { + data: "packages", + size: 1, + alias: "package", + }, + + permalink: function (data) { + return data.package + "/"; + }, +}; diff --git a/src/views/views.11tydata.js b/src/views/views.11tydata.js index 4fecbb5..d14f986 100644 --- a/src/views/views.11tydata.js +++ b/src/views/views.11tydata.js @@ -1,5 +1,5 @@ module.exports = { - pageUrl: function (data) { - return data.page.url - }, -} \ No newline at end of file + pageUrl: function (data) { + return data.page.url; + }, +};