From 24359c9934eb09d00a8e566470a95cd240293a66 Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Wed, 24 Nov 2021 11:05:15 -0500 Subject: [PATCH] initial commit --- .gitignore | 2 ++ app/index.js | 12 ++++++++++++ app/templates/pre-commit-config.yaml.ejs | 14 ++++++++++++++ package.json | 15 +++++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 .gitignore create mode 100644 app/index.js create mode 100644 app/templates/pre-commit-config.yaml.ejs create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..97d4647 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +pnpm-lock.yaml +node_modules/ diff --git a/app/index.js b/app/index.js new file mode 100644 index 0000000..fa9dd96 --- /dev/null +++ b/app/index.js @@ -0,0 +1,12 @@ +const Generator = require("yeoman-generator"); + +module.exports = class extends Generator { + + async writing() { + await this.fs.copyTpl( + this.templatePath('pre-commit-config.yaml.ejs'), + this.destinationPath('.pre-commit-config.yaml.ejs') + ); + } + +}; diff --git a/app/templates/pre-commit-config.yaml.ejs b/app/templates/pre-commit-config.yaml.ejs new file mode 100644 index 0000000..9bb39a2 --- /dev/null +++ b/app/templates/pre-commit-config.yaml.ejs @@ -0,0 +1,14 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.0.1 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - id: check-merge-conflict + - repo: https://github.com/pre-commit/mirrors-prettier + rev: "v2.4.1" # Use the sha / tag you want to point at + hooks: + - id: prettier + additional_dependencies: + - prettier@2.4.1 diff --git a/package.json b/package.json new file mode 100644 index 0000000..4547572 --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "name": "generator-pre-commit", + "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": { + "yeoman-generator": "^5.4.2" + } +}