Skip to content

Default values for configuration? #135

Description

@rethab

Hi,

would you be open for a PR to define some defaults for config values?

For example, the following three are probably safe defaults so users wouldn't need to repeat them:

snapshot-dir=__snapshots__
output-dir=src/test/java
ci-env-var=CI

Obviously it should be built in a way that values can still be overridden via the properties file.

Activity

  1. jackmatt2 commented on Dec 16, 2022

    @jackmatt2
    Collaborator

    I did consider defaults for some of these properties initially. Ultimately, I decided being explicit it better for the following reasons.

    1. You only need to create the snapshot.properties file once. And probably won't ever need to change it again. In most cases it's just a copy paste from the docs.
    2. output-dir: Being explicit about the JVM language makes it clear to Kotlin and Gradle developers that it needs to be changed. If it had a default - it would be confusing for these users as to why it was outputting files into a src/test/java directory. They may quickly abandon it thinking these JVM languages are not supported.
    3. ci-env-var: Although common on cloud CI environments - being explicit here makes the user aware of exactly what environment variable is being used. Perhaps it's not defined on their in house CI system. This makes it clear what is being used - no magic or reading though source code.
    4. snapshot-dir: Being explicit makes it clear that this can be changed if the user doesn't like this particular folder name or coding conventions won't allow it.

    At the end of the day - copying 3 lines of code is the same effort as copying 10 lines. I believe the benefits of being explicit outweigh any cons.

  2. locked and limited conversation to collaborators on Dec 16, 2022
  3. converted this issue into a discussion #137 on Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions