generated from devcontainers/feature-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
538 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
.devcontainer/githooks/_commit-and-tag-version.json | ||
.devcontainer/githooks/_commitlint.json | ||
.devcontainer/githooks/_config.json | ||
.devcontainer/githooks/_git-precommit-checks.json | ||
.devcontainer/githooks/_husky.json | ||
.devcontainer/githooks/_lint-staged.json | ||
.devcontainer/githooks/_prettier.json | ||
.devcontainer/githooks/_scripts.json | ||
.devcontainer/githooks/commit-msg | ||
.devcontainer/githooks/config.json | ||
.devcontainer/githooks/config.sh | ||
.devcontainer/githooks/devcontainer-feature.json | ||
.devcontainer/githooks/install.sh | ||
.devcontainer/githooks/post-checkout | ||
.devcontainer/githooks/post-merge | ||
.devcontainer/githooks/pre-commit | ||
.devcontainer/githooks/pre-push | ||
.devcontainer/githooks/prepare-commit-msg | ||
.devcontainer/githooks/README.md | ||
.devcontainer/githooks/_commit-msg.sh | ||
.devcontainer/githooks/_post-checkout.sh | ||
.devcontainer/githooks/_post-merge.sh | ||
.devcontainer/githooks/_pre-commit.sh | ||
.devcontainer/githooks/_pre-push.sh | ||
.devcontainer/githooks/_prepare-commit-msg.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
{ | ||
"commit-and-tag-version": { | ||
"bumpFiles": [ | ||
{ | ||
"filename": "composer.json", | ||
"type": "json" | ||
}, | ||
{ | ||
"filename": "package.json", | ||
"type": "json" | ||
}, | ||
{ | ||
"filename": "VERSION", | ||
"type": "plain-text" | ||
} | ||
], | ||
"types": [ | ||
{ | ||
"type": "feat", | ||
"section": "Features" | ||
}, | ||
{ | ||
"type": "fix", | ||
"section": "Bug Fixes" | ||
}, | ||
{ | ||
"type": "chore", | ||
"hidden": true | ||
}, | ||
{ | ||
"type": "docs", | ||
"hidden": true | ||
}, | ||
{ | ||
"type": "style", | ||
"hidden": true | ||
}, | ||
{ | ||
"type": "refactor", | ||
"hidden": true | ||
}, | ||
{ | ||
"type": "perf", | ||
"hidden": true | ||
}, | ||
{ | ||
"type": "test", | ||
"hidden": true | ||
} | ||
], | ||
"scripts": { | ||
"prebump": "gitversion -config .gitversion -showvariable MajorMinorPatch" | ||
} | ||
}, | ||
"scripts": { | ||
"release": "commit-and-tag-version --no-verify --", | ||
"lint": "lint-staged", | ||
"update": "npm-check-updates -i -u", | ||
"update-all": "npm run update -ws --root", | ||
"test": "echo \"Warning: no test specified\"" | ||
}, | ||
"commitlint": { | ||
"extends": [ | ||
"@commitlint/config-conventional" | ||
], | ||
"rules": { | ||
"subject-case": [ | ||
2, | ||
"never", | ||
[ | ||
"start-case", | ||
"pascal-case", | ||
"upper-case" | ||
] | ||
], | ||
"scope-enum": [ | ||
2, | ||
"always", | ||
[ | ||
"deps", | ||
"release", | ||
"security", | ||
"i18n", | ||
"config", | ||
"add", | ||
"remove", | ||
"breaking", | ||
"modules", | ||
"packages", | ||
"ui-ux", | ||
"api", | ||
"model" | ||
] | ||
] | ||
} | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "@commitlint/cz-commitlint" | ||
} | ||
}, | ||
"git-precommit-checks": { | ||
"rules": [ | ||
{ | ||
"message": "You've got leftover conflict markers", | ||
"regex": "/^[<>|=]{4,}/m" | ||
}, | ||
{ | ||
"filter": "(^package\\.json|\\.git-precommit-checks.json)$", | ||
"message": "You have unfinished devs", | ||
"nonBlocking": "true", | ||
"regex": "(?:FIXME|TODO)" | ||
} | ||
] | ||
}, | ||
"lint-staged": { | ||
"*.{js,jsx,ts,tsx,md,html,css,json,vue, yaml, yml}": [ | ||
"prettier --write" | ||
], | ||
"*.php": [ | ||
"composer lint" | ||
] | ||
}, | ||
"prettier": { | ||
"trailingComma": "es5", | ||
"tabWidth": 4, | ||
"semi": false, | ||
"singleQuote": true, | ||
"insertPragma": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
# Git Utils | ||
|
||
This feature provides a set of utilities for working with Git repositories. | ||
|
||
The following aliases are included: [./alias.json](./src/gitutils/alias.json) | ||
|
||
## Example Usage | ||
|
||
```json | ||
"features": { | ||
"ghcr.io/tomgrv/devcontainer-features/gitutils:1": { | ||
"version": "latest" | ||
} | ||
} | ||
``` | ||
|
||
## Options | ||
|
||
| Options Id | Description | Type | Default Value | | ||
|-----|-----|-----|-----| | ||
| version | The version of GitUtils to install. | string | latest | | ||
|
||
## GitFlow | ||
|
||
Additionnaly, the feature installs the [git-flow](https:://github.com/nvie/gitflow) extension and sets up the Git configuration to use it. | ||
|
||
Shortcuts are also added to the `git` command to make it easier to use the `git-flow` commands: | ||
|
||
- `git beta` is a shortcut for `git flow release start` | ||
- `git hfix` is a shortcut for `git flow hotfix start` | ||
- `git prod` is a shortcut for `git flow release finish` and `git flow hotfix finish` | ||
|
||
Those shortcuts work in cunjunction with the `gitversion` utility to automatically update the version number of the application. | ||
|
||
## Interactive Utilities | ||
|
||
- `git fixup` - Amend the specified commit with current changes and rebase | ||
|
||
## Contributing | ||
|
||
If you have a feature that you would like to add to this repository, please open an issue or submit a pull request. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"commit-and-tag-version": { | ||
"bumpFiles": [ | ||
{ | ||
"filename": "composer.json", | ||
"type": "json" | ||
}, | ||
{ | ||
"filename": "package.json", | ||
"type": "json" | ||
}, | ||
{ | ||
"filename": "VERSION", | ||
"type": "plain-text" | ||
} | ||
], | ||
"types": [ | ||
{ | ||
"type": "feat", | ||
"section": "Features" | ||
}, | ||
{ | ||
"type": "fix", | ||
"section": "Bug Fixes" | ||
}, | ||
{ | ||
"type": "chore", | ||
"hidden": true | ||
}, | ||
{ | ||
"type": "docs", | ||
"hidden": true | ||
}, | ||
{ | ||
"type": "style", | ||
"hidden": true | ||
}, | ||
{ | ||
"type": "refactor", | ||
"hidden": true | ||
}, | ||
{ | ||
"type": "perf", | ||
"hidden": true | ||
}, | ||
{ | ||
"type": "test", | ||
"hidden": true | ||
} | ||
] | ||
}, | ||
"scripts": { | ||
"release": "commit-and-tag-version --no-verify --" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
export PATH=/usr/bin:$PATH | ||
|
||
# Enable colors | ||
if [ -t 1 ]; then | ||
exec >/dev/tty 2>&1 | ||
fi | ||
|
||
# Apply commitlint rules to the latest commit message | ||
npx chalk-cli --no-stdin -t "{blue →} Applying commitlint rules to the latest commit..." | ||
PLUGINS=$(cat package.json | npx jqn '.commitlint.extends' | tr -d "'[]:") | ||
npm list --global $PLUGINS 2>/dev/null 1>&2 || npm install --global $PLUGINS 2>/dev/null 1>&2 && npx commitlint --edit "$1" && npx devmoji -e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"commitlint": { | ||
"extends": ["@commitlint/config-conventional"], | ||
"rules": { | ||
"subject-case": [ | ||
2, | ||
"never", | ||
["start-case", "pascal-case", "upper-case"] | ||
], | ||
"scope-enum": [ | ||
2, | ||
"always", | ||
[ | ||
"deps", | ||
"release", | ||
"security", | ||
"i18n", | ||
"config", | ||
"add", | ||
"remove", | ||
"breaking", | ||
"modules", | ||
"packages", | ||
"ui-ux", | ||
"api", | ||
"model" | ||
] | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"config": { | ||
"commitizen": { | ||
"path": "@commitlint/cz-commitlint" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"git-precommit-checks": { | ||
"rules": [ | ||
{ | ||
"message": "You've got leftover conflict markers", | ||
"regex": "/^[<>|=]{4,}/m" | ||
}, | ||
{ | ||
"filter": "(^package\\.json|\\.git-precommit-checks.json)$", | ||
"message": "You have unfinished devs", | ||
"nonBlocking": "true", | ||
"regex": "(?:FIXME|TODO)" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"scripts": { | ||
"lint": "lint-staged" | ||
}, | ||
"lint-staged": { | ||
"*.{js,jsx,ts,tsx,md,html,css,json,vue, yaml, yml}": [ | ||
"prettier --write" | ||
], | ||
"*.php": [ | ||
"composer lint" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
export PATH=/usr/bin:$PATH | ||
|
||
# Enable colors | ||
if [ -t 1 ]; then | ||
exec >/dev/tty 2>&1 | ||
fi | ||
|
||
# Check if file changed | ||
isChanged() { | ||
git diff --name-only HEAD@{1} HEAD | grep "^$1" >/dev/null 2>&1 | ||
} | ||
|
||
# Check if rebase | ||
isRebase() { | ||
git rev-parse --git-dir | grep -q 'rebase-merge' || git rev-parse --git-dir | grep -q 'rebase-apply' >/dev/null 2>&1 | ||
} | ||
|
||
# Check if the current Git command is a rebase | ||
if test "$GIT_COMMAND" = "rebase"; then | ||
npx chalk-cli --no-stdin -t "{green ✔} Skip post-checkout hook during rebase." | ||
exit 0 | ||
fi |
Oops, something went wrong.