From 20f4d0a6dbd9003e6169ebb3086661980e686e48 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Thu, 1 Dec 2022 12:50:41 -0500 Subject: [PATCH 1/4] add pre-commit --- .pre-commit-config.yaml | 20 ++++++++++++++++++++ 2022/Taskfile.yaml | 2 ++ 2 files changed, 22 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..26cf8f5 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,20 @@ +default_stages: + - merge-commit + - push + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: end-of-file-fixer + stages: [merge-commit, push] + - id: trailing-whitespace + stages: [merge-commit, push] + - id: check-merge-conflict + - repo: local + hooks: + - id: lint + name: lint + entry: task lint:fix -- + language: system + files: '' diff --git a/2022/Taskfile.yaml b/2022/Taskfile.yaml index 51b2a82..307d714 100644 --- a/2022/Taskfile.yaml +++ b/2022/Taskfile.yaml @@ -6,6 +6,8 @@ vars: GREETING: Hello, World! tasks: + "precommit:init": pre-commit install -t pre-merge-commit -t pre-push + default: cmds: - echo "{{.GREETING}}" From 3ad463f1dd493aed69dc9f9d283b3f39a01360e8 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Thu, 1 Dec 2022 13:04:28 -0500 Subject: [PATCH 2/4] package.json and vitest.config.js --- 2022/package.json | 19 +++++++++++++++++++ 2022/vitest.config.js | 9 +++++++++ 2 files changed, 28 insertions(+) create mode 100644 2022/package.json create mode 100644 2022/vitest.config.js diff --git a/2022/package.json b/2022/package.json new file mode 100644 index 0000000..c1baac4 --- /dev/null +++ b/2022/package.json @@ -0,0 +1,19 @@ +{ + "name": "2022", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "Yanick Champoux (http://techblog.babyl.ca/)", + "license": "ISC", + "dependencies": { + "debug": "^4.3.4", + "fs-extra": "^11.1.0", + "prettier": "^2.8.0", + "remeda": "^1.3.0", + "vitest": "^0.25.3" + } +} diff --git a/2022/vitest.config.js b/2022/vitest.config.js new file mode 100644 index 0000000..a3351cb --- /dev/null +++ b/2022/vitest.config.js @@ -0,0 +1,9 @@ +/// +import { defineConfig } from 'vite' + +export default defineConfig({ + test: { + include: [ '**/*test.js' ], + // ... + }, +}) From ab75d950de3a737e81480881fa254df805157d31 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Thu, 1 Dec 2022 13:15:20 -0500 Subject: [PATCH 3/4] move to the root directory --- .gitignore | 1 + 2022/Taskfile.yaml => Taskfile.yaml | 5 +++++ 2022/package.json => package.json | 0 2022/vitest.config.js => vitest.config.js | 0 4 files changed, 6 insertions(+) rename 2022/Taskfile.yaml => Taskfile.yaml (72%) rename 2022/package.json => package.json (100%) rename 2022/vitest.config.js => vitest.config.js (100%) diff --git a/.gitignore b/.gitignore index f9ba736..2b0c653 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules .pls_cache/ .perl-version +pnpm-lock.yaml diff --git a/2022/Taskfile.yaml b/Taskfile.yaml similarity index 72% rename from 2022/Taskfile.yaml rename to Taskfile.yaml index 307d714..0d33226 100644 --- a/2022/Taskfile.yaml +++ b/Taskfile.yaml @@ -8,6 +8,11 @@ vars: tasks: "precommit:init": pre-commit install -t pre-merge-commit -t pre-push + + lint:fix: + cmds: + - npx prettier --write {{.CLI_ARGS | default "." }} + default: cmds: - echo "{{.GREETING}}" diff --git a/2022/package.json b/package.json similarity index 100% rename from 2022/package.json rename to package.json diff --git a/2022/vitest.config.js b/vitest.config.js similarity index 100% rename from 2022/vitest.config.js rename to vitest.config.js From 5ca8e8d01f8221b287e6f1c2ba98ee419689fb94 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Thu, 1 Dec 2022 13:55:34 -0500 Subject: [PATCH 4/4] add integrate task --- Taskfile.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Taskfile.yaml b/Taskfile.yaml index 0d33226..d63017c 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -8,6 +8,11 @@ vars: tasks: "precommit:init": pre-commit install -t pre-merge-commit -t pre-push + integrate: + cmds: + - git is-clean + - git co main + - git weld - lint:fix: cmds: