Skip to content

Commit

Permalink
feat: adds skipAnalysisNotInRules option (schema, types and docs)
Browse files Browse the repository at this point in the history
  • Loading branch information
sverweij committed Jan 4, 2025
1 parent d2550e4 commit 5567905
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 6 deletions.
14 changes: 14 additions & 0 deletions doc/options-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
- [enhancedResolveOptions](#enhancedresolveoptions)
- [forceDeriveDependents](#forcederivedependents)
- [experimentalStats](#experimentalstats)
- [skipAnalysisNotInRules](#skipanalysisnotinrules)
- [parser](#parser)
- [cache](#cache)
- [progress](#progress)
Expand Down Expand Up @@ -1679,6 +1680,19 @@ in the result for each module. This feature is not yet used by any of the
reporters dependency-cruiser ships with. The feature is also _experimental_
which means it might disappear or change in the future.
### `skipAnalysisNotInRules`
When this flag is set to `true`, dependency-cruiser will skip all analysis that
don't serve a rule. E.g. if there's no 'circular' rule in the rule set it won't
analyse cycles. This flag affects cycle, dependents, orphan, and reachability
analysis. If you have a rule set that doesn't use one of these features,
switching it to true will make cruises faster.
Defaults to `false` for backwards compatibility. However, we recommend to switch
this option to `true`, unless you have a specific use case (i.e. use the json
output for further analysis, using the API).
### `parser`
With this _EXPERIMENTAL_ feature you can specify which parser you want to use
Expand Down
4 changes: 4 additions & 0 deletions src/schema/configuration.schema.json

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

2 changes: 1 addition & 1 deletion src/schema/configuration.schema.mjs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/schema/cruise-result.schema.json

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

2 changes: 1 addition & 1 deletion src/schema/cruise-result.schema.mjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions tools/schema/options-used.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ export default {
experimentalStats: {
type: "boolean",
},
skipAnalysisNotInRules: {
type: "boolean",
},
// for backwards compatibility reasons can be either a string, false
// or an object in the input, but for internal processing and output
// always put as an object
Expand Down
11 changes: 11 additions & 0 deletions tools/schema/options.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,17 @@ export default {
"Will be renamed when the 'experimental' state is lifted. " +
"Defaults to false.",
},
skipAnalysisNotInRules: {
type: "boolean",
description:
"When this flag is set to true, dependency-cruiser will skip all analysis " +
"that don't serve a rule. E.g. if there's no 'circular' rule in the rule set " +
"it won't analyse cycles. This flag affects cycle, dependents, orphan, and " +
"reachability analysis. If you have a rule set that doesn't use one of these " +
"features, switching it to true will make cruises faster. " +
"Defaults to false for backwards compatibility. For most uses of dependency-cruiser " +
"we recommend to switch this option to true, though.",
},
baseDir: {
type: "string",
description:
Expand Down
21 changes: 17 additions & 4 deletions types/options.d.mts
Original file line number Diff line number Diff line change
Expand Up @@ -383,13 +383,26 @@ export interface ICruiseOptions {
metrics?: boolean;

/**
* When this flag is set to true, dependency-cruiser will calculate some " +
* stats for each module. Has some performance impact. EXPERIMENTAL " +
* Will be renamed when the 'experimental' state is lifted." +
* Defaults to false.",*
* When this flag is set to true, dependency-cruiser will calculate some
* stats for each module. Has some performance impact. EXPERIMENTAL
* Will be renamed when the 'experimental' state is lifted.
*
* Defaults to false.
*/
experimentalStats?: boolean;

/**
* When this flag is set to true, dependency-cruiser will skip all analysis
* that don't serve a rule. E.g. if there's no 'circular' rule in the rule set
* it won't analyse cycles. This flag affects cycle, dependents, orphan, and
* reachability analysis. If you have a rule set that doesn't use one of these
* features, switching it to true will make cruises faster.
*
* Defaults to false for backwards compatibility - for most uses of
* dependency-cruiser we recommend to switch this option to true, though.
*/
skipAnalysisNotInRules?: boolean;

/**
* - false: don't use caching.
* - true or empty object: use caching with the default settings
Expand Down

0 comments on commit 5567905

Please sign in to comment.