From 001734b83d73b870ad7ff1ff9f8633cb29f543f2 Mon Sep 17 00:00:00 2001 From: teksturepako <71150936+juraj-hrivnak@users.noreply.github.com> Date: Fri, 31 Jan 2025 23:15:19 +0100 Subject: [PATCH 1/2] Update CONTRIBUTING.md --- CONTRIBUTING.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1d7b6cb..5871071 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,13 +14,13 @@ To run tests, run the `jvmTest` Gradle task (`gradlew jvmTest`). Pakku uses Clikt to handle the CLI. It is advised to [check out its docs](https://ajalt.github.io/clikt/). Command classes should be called the same as the command itself. -If the command is a subcommand, name it using in this pattern: ``; example: `CfgPrj`. +If the command is a subcommand, name it using this pattern: ``; example: `CfgPrj`. Command parameters should be _suffixed_ with a special abbreviation of the parameter type. (``) Use: `Opt` for options, `Arg` for arguments, and `Flag` for flags (Boolean options). If there can be multiple parameters use the plural, e.g. `Opts`, `Args`. -Defining of parameters using a chain of function calls is preferred. +Defining parameters using a chain of function calls is preferred. ```kt // Parameters should be always private. @@ -43,18 +43,18 @@ Documentation for commands can be generated automatically by running: `pakku --g ## Testing -When creating test please extend the `PakkuTest` class. +When creating a test please extend the `PakkuTest` class. It will ensure every test is run separately in the `build/test/` directory, and also automatically handle the working path of Pakku and teardown of any created files while running the tests. -For testing we use the [Strikt](https://strikt.io/) assertion library, because it is easy to use, read and debug. +For testing, we use the [Strikt](https://strikt.io/) assertion library because it is easy to use, read and debug. Example of a test: ```kt class ExampleTest : PakkuTest() { - private val testFileName = "test_file.txt" // Define test data on the top of the class + private val testFileName = "test_file.txt" // Define test data at the top of the class override suspend fun `set-up`() // Override this function to implement set up { @@ -74,4 +74,4 @@ class ExampleTest : PakkuTest() expectThat(file).get { exists() }.isTrue() // Test whether the file exists. } } -``` \ No newline at end of file +``` From 19e5d950d82ff0ac782dc06701b2934716672385 Mon Sep 17 00:00:00 2001 From: teksturepako <71150936+juraj-hrivnak@users.noreply.github.com> Date: Fri, 31 Jan 2025 23:15:48 +0100 Subject: [PATCH 2/2] Update CONTRIBUTING.md --- CONTRIBUTING.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5871071..94db607 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,10 +20,9 @@ Command parameters should be _suffixed_ with a special abbreviation of the param Use: `Opt` for options, `Arg` for arguments, and `Flag` for flags (Boolean options). If there can be multiple parameters use the plural, e.g. `Opts`, `Args`. -Defining parameters using a chain of function calls is preferred. - ```kt // Parameters should be always private. +// Defining parameters using a chain of function calls is preferred. private val exampleOpt by option("--example") // Consult if a short version `-e` of the option is a good idea .help("...") // Consider discussing the help message