-
Notifications
You must be signed in to change notification settings - Fork 46
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
Self-documenting settings template #1420
Conversation
Experiments with Gradle tasks
UTSettings.kt -> settings.properties, first iteration with several yet-not-parsed (skipped) properties
Split Single description for bunch options to dedicated ones in code Get rid of default value description in code Skip <a href... lines Support both var/val options Add empty lines between description/enum values/default to make output more user-friendly
…s wording in sourcecode
Save template to user's local file if absent Add some documentation comments
…ent to TestCaseGenerator.kt:300 some time ago) Get rid of unused property singleSelector Delete resource file settings.properties that is designed to be re-generated locally from the repository
…er-defined custom settings Make newly created ".utbot" folder hidden under Windows only
Make all properties commented to be free switch our hardcoded defaults later if any.
Some ideas from our discussion with @Vassiliy-Kudryashov and @olganaumenko:
|
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.
LNVGTM, but it seems to be our way now. Discussed verbally with Vasya. Some potential mines are going to be removed in further implementations.
Also I suggest to test it in branch before merge.
@Vassiliy-Kudryashov Please check: To reproduce
Expected behavior Test generation timeout should be 1 sec Actual behavior Default test generation timeout is applied - 60 sec Additional context The same issue is when executing runIde task. |
@Vassiliy-Kudryashov Could you please correct the naming of |
@Vassiliy-Kudryashov
|
@Vassiliy-Kudryashov @Domonion |
Change copyright in the license template to utbot.org
* Convert 'UTSettings.kt' into '.utbot/settings.properties' * Add Apache 2.0 license to settings.properties output and tune comments wording in sourcecode * Add template generation to gradle build process * Add AbstractSettings.areCustomized() ability to tell template from user-defined custom settings * Make all properties commented to be free switch our hardcoded defaults later if any. * Fix an issue with always-default settings state. * Change copyright in the license template to utbot.org * Fix a misprint in UtSettings property name "treatAssertAsErrorSuite"
Description
There is new helper to be used from Gradle task. It converts UtSettings.kt to resource file settings.properties.
So, actual state of UtSettings.kt (properties, defauls, relevant documentation comments) will allways be converted to bundled resource file we publish along with the plugin as top-level entry inside utbot-intellij-{version}.jar file.
Note, the template contains commented lines only so we free to change our hardcoded defaults later and re-write outdated template with new one until it's customized by user.
Just after IDE start (namely when plugin loads its settings) we check if settings.properties is presented in user's local file system as {home}/.utbot/settings.properties:
Fixes #1412
Type of Change
How Has This Been Tested?
Manual Scenarios
Scenario 1
The folder {home}/.utbot should be created automatically, for Windows it also should be marked as "hidden file".
There should be template file settings.properties inside.
If you delete the file it should appear again after IDE restart.
Scenario 2
As soon as property file contains defaults, it should be re-writen with template.
Scenario 3
Checklist (remove irrelevant options):