Loading .pre-commit-config.yaml 0 → 100644 +14 −0 Original line number Diff line number Diff line repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v2.3.0 hooks: - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks rev: v1.6.1 hooks: - id: pretty-format-kotlin args: [--autofix, --ktlint-version, 0.39.0] - id: pretty-format-yaml args: [--autofix, --indent, '2'] README.md +10 −3 Original line number Diff line number Diff line Loading @@ -10,3 +10,10 @@ installation instructions on your platform. ```./tesh.sh``` This will run all the unit tests, codegen an example model end-to-end and validates that the generated code compiles. ## Development For development, pre-commit hooks may be useful. Setup: ``` brew install pre-commit # (or appropriate for your platform: https://pre-commit.com/) pre-commit install ``` codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/lang/RustWriter.kt +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,6 @@ package software.amazon.smithy.rust.codegen.lang import java.util.function.BiFunction import software.amazon.smithy.codegen.core.CodegenException import software.amazon.smithy.codegen.core.Symbol import software.amazon.smithy.codegen.core.writer.CodegenWriter Loading @@ -17,6 +16,7 @@ import software.amazon.smithy.rust.codegen.smithy.RuntimeType import software.amazon.smithy.rust.codegen.smithy.isOptional import software.amazon.smithy.rust.codegen.smithy.rustType import software.amazon.smithy.utils.CodeWriter import java.util.function.BiFunction fun <T : CodeWriter> T.withBlock( textBeforeNewLine: String, Loading codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/CodegenVisitor.kt +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,6 @@ package software.amazon.smithy.rust.codegen.smithy import java.util.logging.Logger import software.amazon.smithy.build.PluginContext import software.amazon.smithy.codegen.core.SymbolProvider import software.amazon.smithy.codegen.core.writer.CodegenWriterDelegator Loading @@ -29,6 +28,7 @@ import software.amazon.smithy.rust.codegen.smithy.generators.UnionGenerator import software.amazon.smithy.rust.codegen.smithy.transformers.OperationNormalizer import software.amazon.smithy.rust.codegen.util.CommandFailed import software.amazon.smithy.rust.codegen.util.runCommand import java.util.logging.Logger private val PublicModules = listOf("error", "operation", "model") Loading codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/RuntimeTypes.kt +2 −2 Original line number Diff line number Diff line Loading @@ -5,13 +5,13 @@ package software.amazon.smithy.rust.codegen.smithy import java.io.File import java.util.Optional import software.amazon.smithy.codegen.core.Symbol import software.amazon.smithy.model.node.ObjectNode import software.amazon.smithy.model.traits.TimestampFormatTrait import software.amazon.smithy.rust.codegen.lang.RustDependency import software.amazon.smithy.rust.codegen.lang.RustType import java.io.File import java.util.Optional data class RuntimeConfig(val cratePrefix: String = "smithy", val relativePath: String = "../") { companion object { Loading Loading
.pre-commit-config.yaml 0 → 100644 +14 −0 Original line number Diff line number Diff line repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v2.3.0 hooks: - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks rev: v1.6.1 hooks: - id: pretty-format-kotlin args: [--autofix, --ktlint-version, 0.39.0] - id: pretty-format-yaml args: [--autofix, --indent, '2']
README.md +10 −3 Original line number Diff line number Diff line Loading @@ -10,3 +10,10 @@ installation instructions on your platform. ```./tesh.sh``` This will run all the unit tests, codegen an example model end-to-end and validates that the generated code compiles. ## Development For development, pre-commit hooks may be useful. Setup: ``` brew install pre-commit # (or appropriate for your platform: https://pre-commit.com/) pre-commit install ```
codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/lang/RustWriter.kt +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,6 @@ package software.amazon.smithy.rust.codegen.lang import java.util.function.BiFunction import software.amazon.smithy.codegen.core.CodegenException import software.amazon.smithy.codegen.core.Symbol import software.amazon.smithy.codegen.core.writer.CodegenWriter Loading @@ -17,6 +16,7 @@ import software.amazon.smithy.rust.codegen.smithy.RuntimeType import software.amazon.smithy.rust.codegen.smithy.isOptional import software.amazon.smithy.rust.codegen.smithy.rustType import software.amazon.smithy.utils.CodeWriter import java.util.function.BiFunction fun <T : CodeWriter> T.withBlock( textBeforeNewLine: String, Loading
codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/CodegenVisitor.kt +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,6 @@ package software.amazon.smithy.rust.codegen.smithy import java.util.logging.Logger import software.amazon.smithy.build.PluginContext import software.amazon.smithy.codegen.core.SymbolProvider import software.amazon.smithy.codegen.core.writer.CodegenWriterDelegator Loading @@ -29,6 +28,7 @@ import software.amazon.smithy.rust.codegen.smithy.generators.UnionGenerator import software.amazon.smithy.rust.codegen.smithy.transformers.OperationNormalizer import software.amazon.smithy.rust.codegen.util.CommandFailed import software.amazon.smithy.rust.codegen.util.runCommand import java.util.logging.Logger private val PublicModules = listOf("error", "operation", "model") Loading
codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/RuntimeTypes.kt +2 −2 Original line number Diff line number Diff line Loading @@ -5,13 +5,13 @@ package software.amazon.smithy.rust.codegen.smithy import java.io.File import java.util.Optional import software.amazon.smithy.codegen.core.Symbol import software.amazon.smithy.model.node.ObjectNode import software.amazon.smithy.model.traits.TimestampFormatTrait import software.amazon.smithy.rust.codegen.lang.RustDependency import software.amazon.smithy.rust.codegen.lang.RustType import java.io.File import java.util.Optional data class RuntimeConfig(val cratePrefix: String = "smithy", val relativePath: String = "../") { companion object { Loading