-
Notifications
You must be signed in to change notification settings - Fork 45
Vassiliy kudryashov/extended settings documentation #1501
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
Merged
Vassiliy-Kudryashov
merged 9 commits into
main
from
Vassiliy-Kudryashov/extended_settings_documentation
Dec 15, 2022
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a9c21b5
Draft for extended settings documentation
Vassiliy-Kudryashov 32738e2
Extended settings documentation
Vassiliy-Kudryashov 1fde95f
Small grammar fixes
Vassiliy-Kudryashov e940746
Merge branch 'main' into Vassiliy-Kudryashov/extended_settings_docume…
Vassiliy-Kudryashov 73ac73a
Merge branch 'main' into Vassiliy-Kudryashov/extended_settings_docume…
Vassiliy-Kudryashov ec2bdfe
Merge branch 'main' into Vassiliy-Kudryashov/extended_settings_docume…
Vassiliy-Kudryashov 8791815
Minor linguistic fixes
olganaumenko efc93c8
Merge remote-tracking branch 'origin/Vassiliy-Kudryashov/extended_set…
olganaumenko bfb50b3
Merge branch 'main' into Vassiliy-Kudryashov/extended_settings_docume…
Vassiliy-Kudryashov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Small grammar fixes
- Loading branch information
commit 1fde95fd69169b8cafdc4469bbbd47abdca53199
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| # UnitTestBot Settings | ||
|
|
||
| First, let's define the term "**settings**" as set of "**properties**" of the form '_key=value_' that | ||
| may be represented as source code and as plain text stored in a file. | ||
| Altogether this set affects key aspects of behavior of UnitTestBot. | ||
| First, let's define the term "**settings**" as "**properties**" set. | ||
| Each property is of the form '_key=value_' and it may be represented as source code and as a plain text stored in a file. | ||
| Altogether, this set affects key aspects of UnitTestBot behavior. | ||
|
|
||
| UnitTestBot works as following applications: | ||
| - IntelliJ plugin | ||
|
|
@@ -15,20 +15,20 @@ we also have per-project _**plugin-specific**_ settings. | |
| ## Core settings | ||
| Core settings are being persisted in file located in **_settings file_** `{userHome}/.utbot/settings.properties` | ||
| This file is designed for reading only. | ||
| All defaults for core settings are provided in source code (namely in `UtSettings.kt`) so the file itself may absent or exist with a few of customized properties only, | ||
| for example file with just one line like `utBotGenerationTimeoutInMillis=15000` is valid and useful. | ||
| All defaults for core settings are provided in source code (namely in `UtSettings.kt`) so the file itself may absent or exist with a few of the customized properties only, | ||
| for example, file with just one line like `utBotGenerationTimeoutInMillis=15000` is valid and useful. | ||
|
|
||
| ## Plugin-specific settings | ||
| Plugin-specific settings are being persisted automatically by IDE (per-project!) | ||
| in **plugin configuration file** `{projectDir}/.idea/utbot-settings.xml` and nobody is expected to edit this file manually. | ||
|
|
||
| At the moment, these two kinds of settings (core and plugin-specific) | ||
| have very small intersection. | ||
| In case of properties intersection Core settings should act as provider of defaults for plugin-specific settings. | ||
| have very small intersection (that means some keys of different levels control the same behavior aspects). | ||
| In case of properties' intersection, Core settings should act as a provider of defaults for Plugin-specific settings. | ||
| As for now, this concept is partially implemented. | ||
|
|
||
| ## Categories of properties | ||
| Every newly added feature tends to be represented in settings as subset of properties, | ||
| Every newly added feature tends to be represented in settings as a subset of properties, | ||
| and the question is the choice of proper "level". There are several categories of properties we have in practice: | ||
| - **Hardcoded directly as constants in sourcecode** | ||
| _It means one can build own build of plugin with different hardcoded preset._ | ||
|
|
@@ -42,12 +42,14 @@ _End-user can tweak them in **File** > **Settings** > **Tools** > **UnitTestBot* | |
| - **Small set of per-generation options** | ||
| Thereby, some properties can be considered as public API while the rest is pretty "internal". | ||
|
|
||
| For user there are three places to tweak UnitTestBot behavior: | ||
| For end-user there are three places to tweak UnitTestBot behavior: | ||
| 1. Settings file is PC-wide level to be read by all UnitTestBot instances across PC. | ||
| For example, CLI and two different projects in IDE will re-use it. | ||
| 2. Plugin settings UI (**File** > **Settings** > **Tools** > **UnitTestBot**) | ||
| 3. Controls in "Generate" dialog | ||
| Settings in 2 and 3 are plugin-specific and they are automatically persisted in {projectDir}/.idea/utbot-settings.xml | ||
| 3. Controls in "Generate" dialog | ||
|
|
||
|
|
||
| Properties from 2 and 3 are plugin-specific, and they are automatically persisted in `{projectDir}/.idea/utbot-settings.xml` | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually not all settings on UI are plugin-specific. They are:
Most of settings on UI can be used for CLI and CI as well (and they are not used in
|
||
| (Note, only non-default values are stored here) | ||
|
|
||
| ## Configuring UnitTestBot with auto-generated `settings.properties` | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intersection of settings in global settings.properties file and IDEA UI: