Skip to content

Commit

Permalink
improve defaults docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gabotechs committed Dec 26, 2023
1 parent d300569 commit 9cf6415
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
8 changes: 4 additions & 4 deletions cmd/.root_test/.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ Available Commands:
Flags:
-c, --config string path to dep-tree's config file (default .dep-tree.yml)
--exclude stringArray Files that match this glob pattern will be ignored. You can provide an arbitrary number of --exclude flags
--follow-re-exports whether to follow re-exports or not while resolving imports between files (default true)
--follow-re-exports follow re-exports while resolving imports between files
-h, --help help for dep-tree
--js-follow-ts-config-paths whether to follow the tsconfig.json paths while resolving imports or not (default false)
--js-follow-workspaces whether to take the workspaces attribute in the root package.json into account or not (default false)
--python-exclude-conditional-imports exclude conditional imports while calculating file dependencies, like imports wrapped inside if statements (default false)
--js-follow-ts-config-paths follow the tsconfig.json paths while resolving imports (default true)
--js-follow-workspaces take the workspaces attribute in the root package.json into account for resolving paths (default true)
--python-exclude-conditional-imports exclude conditional imports while calculating file dependencies, like imports wrapped inside if statements
-v, --version version for dep-tree

Use "dep-tree [command] --help" for more information about a command.
8 changes: 4 additions & 4 deletions cmd/.root_test/help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ Available Commands:
Flags:
-c, --config string path to dep-tree's config file (default .dep-tree.yml)
--exclude stringArray Files that match this glob pattern will be ignored. You can provide an arbitrary number of --exclude flags
--follow-re-exports whether to follow re-exports or not while resolving imports between files (default true)
--follow-re-exports follow re-exports while resolving imports between files
-h, --help help for dep-tree
--js-follow-ts-config-paths whether to follow the tsconfig.json paths while resolving imports or not (default false)
--js-follow-workspaces whether to take the workspaces attribute in the root package.json into account or not (default false)
--python-exclude-conditional-imports exclude conditional imports while calculating file dependencies, like imports wrapped inside if statements (default false)
--js-follow-ts-config-paths follow the tsconfig.json paths while resolving imports (default true)
--js-follow-workspaces take the workspaces attribute in the root package.json into account for resolving paths (default true)
--python-exclude-conditional-imports exclude conditional imports while calculating file dependencies, like imports wrapped inside if statements
-v, --version version for dep-tree

Use "dep-tree [command] --help" for more information about a command.
8 changes: 4 additions & 4 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ func NewRoot(args []string) *cobra.Command {

root.PersistentFlags().StringVarP(&configPath, "config", "c", "", "path to dep-tree's config file (default .dep-tree.yml)")
// TODO: call this '--unwrap-exports'
root.PersistentFlags().BoolVar(&followReExports, "follow-re-exports", true, "whether to follow re-exports or not while resolving imports between files")
root.PersistentFlags().BoolVar(&followReExports, "follow-re-exports", false, "follow re-exports while resolving imports between files")
// TODO: call this '--js-tsconfig-paths'
root.PersistentFlags().BoolVar(&jsFollowTsConfigPaths, "js-follow-ts-config-paths", false, "whether to follow the tsconfig.json paths while resolving imports or not (default false)")
root.PersistentFlags().BoolVar(&jsFollowTsConfigPaths, "js-follow-ts-config-paths", true, "follow the tsconfig.json paths while resolving imports")
// TODO: call this '--js-workspaces'
root.PersistentFlags().BoolVar(&jsFollowWorkspaces, "js-follow-workspaces", false, "whether to take the workspaces attribute in the root package.json into account or not (default false)")
root.PersistentFlags().BoolVar(&pythonExcludeConditionalImports, "python-exclude-conditional-imports", false, "exclude conditional imports while calculating file dependencies, like imports wrapped inside if statements (default false)")
root.PersistentFlags().BoolVar(&jsFollowWorkspaces, "js-follow-workspaces", true, "take the workspaces attribute in the root package.json into account for resolving paths")
root.PersistentFlags().BoolVar(&pythonExcludeConditionalImports, "python-exclude-conditional-imports", false, "exclude conditional imports while calculating file dependencies, like imports wrapped inside if statements")
root.PersistentFlags().StringArrayVar(&exclude, "exclude", nil, "Files that match this glob pattern will be ignored. You can provide an arbitrary number of --exclude flags")

switch {
Expand Down
7 changes: 6 additions & 1 deletion internal/config/sample-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,13 @@ check:

# JavaScript and TypeScript specific settings.
js:
# Whether to take package.json workspaces into account while resolving paths
# or not. You might want to disable if you only want to analyze one workspace
# in a monorepo.
followWorkspaces: true
# Whether to follow tsconfig.json paths or not. You will typically want to
# enable this, but for some monorepo setups, it might be better to leave this off.
# enable this, but for some monorepo setups, it might be better to leave this off
# if you want to analyze only one package.
followTsConfigPaths: true

# Python specific settings.
Expand Down

0 comments on commit 9cf6415

Please sign in to comment.