Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Custom folder path support #110

Merged
merged 3 commits into from
May 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .mookme.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"packagesPath": "./packages",
"packages": [
"docs",
"mookme"
],
"addedBehavior": "exit"
"addedBehavior": "exit",
"noClearRenderer": true
}
27 changes: 2 additions & 25 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
const Configuration = {
/*
* Resolve and load @commitlint/config-conventional from node_modules.
* Referenced packages must be installed
*/
extends: ["@commitlint/config-angular"],
/*
* Resolve and load @commitlint/format from node_modules.
* Referenced package must be installed yep
*/
formatter: "@commitlint/format",
/*
* Whether commitlint uses the default ignore rules.
*/
defaultIgnores: true,
/*
* Custom URL to show upon failure
*/
helpUrl:
"https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#-commit-message-guidelines",
rules: {
"type-enum": [2, 'always' ,["ci", "docs", "feat", "fix", "refactor", "test", "chore"]],
},
module.exports = {
extends: ['@commitlint/config-conventional']
};

module.exports = Configuration;
62 changes: 36 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"homepage": "https://github.com/Escape-Technologies/mookme",
"devDependencies": {
"@commitlint/cli": "^17.0.0",
"@commitlint/config-angular": "^17.0.0",
"@commitlint/config-conventional": "^17.6.3",
"@escape.tech/mookme": "^2.2.0"
}
}
4 changes: 4 additions & 0 deletions packages/docs/references/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ Starting git reference used to evaluate hooks to run. If set, `to` has to be set

Ending git reference used to evaluate hooks to run. If set, `from` has to be set as well, otherwise this option is ignored.

- `--config-root` (optional)

The path of the folder where the mookme configuration file (`.mookme.json`) is stored

## `mookme inspect`

Manually test wich packages are discovered and assess if your hooks are properly configured.
Expand Down
3 changes: 2 additions & 1 deletion packages/mookme/src/commands/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ export function addRun(program: commander.Command): void {
.option('--from <from>', 'Starting git reference used to evaluate hooks to run', '')
.option('--to <to>', 'Ending git reference used to evaluate hooks to run', '')
.option('--args <args>', 'The arguments being passed to the hooks', '')
.option('--config-root <configRoot>', 'The path of the folder where the mookme configuration file is stored', '')
.action(async (opts: RunOptions) => {
debug('Running run command with options', opts);
const git = new GitToolkit();

// Load the different config files
const config = new Config(git.rootDir);
const config = new Config(opts.configRoot || git.rootDir);

// Initialize the UI
const ui = new MookmeUI(false, config.noClearRenderer ? new NoClearRenderer() : new FancyRenderer());
Expand Down
4 changes: 4 additions & 0 deletions packages/mookme/src/runner/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export interface RunOptions {
* A boolean parameter to detect if the whole hook suite should be ran, regardless of the VCS state
*/
to: string;
/**
* The path of the folder where the mookme configuration file is stored
*/
configRoot: string;
}

/**
Expand Down