Browse Source

initial commit

main
Yanick Champoux 2 years ago
commit
24359c9934
  1. 2
      .gitignore
  2. 12
      app/index.js
  3. 14
      app/templates/pre-commit-config.yaml.ejs
  4. 15
      package.json

2
.gitignore vendored

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
pnpm-lock.yaml
node_modules/

12
app/index.js

@ -0,0 +1,12 @@ @@ -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')
);
}
};

14
app/templates/pre-commit-config.yaml.ejs

@ -0,0 +1,14 @@ @@ -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

15
package.json

@ -0,0 +1,15 @@ @@ -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 <yanick@babyl.ca> (http://techblog.babyl.ca/)",
"license": "ISC",
"dependencies": {
"yeoman-generator": "^5.4.2"
}
}
Loading…
Cancel
Save