diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DirectedDocGen.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DirectedDocGen.java index 97a9c5d5995..2fad4b9ed0f 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DirectedDocGen.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DirectedDocGen.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen; import software.amazon.smithy.codegen.core.SymbolProvider; @@ -41,12 +40,11 @@ public SymbolProvider createSymbolProvider(CreateSymbolProviderDirective directive) { return new DocGenerationContext( - directive.model(), - directive.settings(), - directive.symbolProvider(), - directive.fileManifest(), - directive.integrations() - ); + directive.model(), + directive.settings(), + directive.symbolProvider(), + directive.fileManifest(), + directive.integrations()); } @Override @@ -86,8 +84,10 @@ public void generateEnumShape(GenerateEnumDirective directive) { var shape = directive.shape(); - var intEnum = shape.asIntEnumShape().orElseThrow(() -> new ExpectationNotMetException( - "Expected an intEnum shape, but found " + shape, shape)); + var intEnum = shape.asIntEnumShape() + .orElseThrow(() -> new ExpectationNotMetException( + "Expected an intEnum shape, but found " + shape, + shape)); new StructuredShapeGenerator(directive.context()).accept(intEnum, MemberListingType.OPTIONS); } diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocFormat.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocFormat.java index 29f3327892f..c5bb8e4dcc7 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocFormat.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocFormat.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen; import software.amazon.smithy.codegen.core.SymbolWriter; @@ -23,5 +22,4 @@ * format. */ @SmithyUnstableApi -public record DocFormat(String name, String extension, SymbolWriter.Factory writerFactory) { -} +public record DocFormat(String name, String extension, SymbolWriter.Factory writerFactory) {} diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocGenerationContext.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocGenerationContext.java index 4147bb9dcca..377c5507a31 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocGenerationContext.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocGenerationContext.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen; import java.util.LinkedHashSet; @@ -66,9 +65,9 @@ public DocGenerationContext( } if (resolvedFormat == null) { throw new CodegenException(String.format( - "Unknown doc format `%s`. You may be missing a dependency. Currently available formats: [%s]", - docSettings.format(), String.join(", ", availableFormats) - )); + "Unknown doc format `%s`. You may be missing a dependency. Currently available formats: [%s]", + docSettings.format(), + String.join(", ", availableFormats))); } this.docFormat = resolvedFormat; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocIntegration.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocIntegration.java index d48bcd5ba1a..1bb6ffdc7c0 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocIntegration.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocIntegration.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen; import java.util.List; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocSettings.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocSettings.java index 119a95653d7..40035701572 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocSettings.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocSettings.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen; import java.util.Map; @@ -45,15 +44,17 @@ public record DocSettings(ShapeId service, String format, Map r * @return loaded settings based on the given node. */ public static DocSettings fromNode(ObjectNode pluginSettings) { - var references = pluginSettings.getObjectMember("references").orElse(ObjectNode.objectNode()) - .getMembers().entrySet().stream() + var references = pluginSettings.getObjectMember("references") + .orElse(ObjectNode.objectNode()) + .getMembers() + .entrySet() + .stream() .collect(Collectors.toMap( e -> ShapeId.from(e.getKey().getValue()), e -> e.getValue().expectStringNode().getValue())); return new DocSettings( pluginSettings.expectStringMember("service").expectShapeId(), pluginSettings.getStringMemberOrDefault("format", "sphinx-markdown"), - references - ); + references); } } diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocSymbolProvider.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocSymbolProvider.java index 8ba40967cec..c72050b24b9 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocSymbolProvider.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocSymbolProvider.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen; import static java.lang.String.format; @@ -180,8 +179,8 @@ public Symbol toSymbol(Shape shape) { @Override public Symbol serviceShape(ServiceShape shape) { return getSymbolBuilder(shape) - .definitionFile(getDefinitionFile(SERVICE_FILE)) - .build(); + .definitionFile(getDefinitionFile(SERVICE_FILE)) + .build(); } @Override @@ -277,8 +276,8 @@ private String getDefinitionFile(String path) { private String getShapeName(ServiceShape serviceShape, Shape shape) { if (shape.isServiceShape()) { return shape.getTrait(TitleTrait.class) - .map(StringTrait::getValue) - .orElse(shape.getId().getName()); + .map(StringTrait::getValue) + .orElse(shape.getId().getName()); } if (shape.isMemberShape()) { return toMemberName(shape.asMemberShape().get()); @@ -326,9 +325,9 @@ public Symbol toSymbol(Shape shape) { return symbol; } return symbol.toBuilder() - .definitionFile(addExtension(symbol.getDefinitionFile())) - .declarationFile(addExtension(symbol.getDeclarationFile())) - .build(); + .definitionFile(addExtension(symbol.getDefinitionFile())) + .declarationFile(addExtension(symbol.getDeclarationFile())) + .build(); } private String addExtension(String path) { diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocgenUtils.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocgenUtils.java index 06dc815222b..de0f90f1666 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocgenUtils.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/DocgenUtils.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen; import static java.lang.String.format; @@ -48,9 +47,9 @@ private DocgenUtils() {} public static String runCommand(String command, Path directory) { String[] finalizedCommand; if (System.getProperty("os.name").toLowerCase().startsWith("windows")) { - finalizedCommand = new String[]{"cmd.exe", "/c", command}; + finalizedCommand = new String[] {"cmd.exe", "/c", command}; } else { - finalizedCommand = new String[]{"sh", "-c", command}; + finalizedCommand = new String[] {"sh", "-c", command}; } ProcessBuilder processBuilder = new ProcessBuilder(finalizedCommand) @@ -63,7 +62,8 @@ public static String runCommand(String command, Path directory) { // Capture output for reporting. try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader( - process.getInputStream(), Charset.defaultCharset()))) { + process.getInputStream(), + Charset.defaultCharset()))) { String line; while ((line = bufferedReader.readLine()) != null) { LOGGER.finest(line); @@ -77,7 +77,9 @@ public static String runCommand(String command, Path directory) { String joinedOutput = String.join(System.lineSeparator(), output); if (process.exitValue() != 0) { throw new CodegenException(format( - "Command `%s` failed with output:%n%n%s", command, joinedOutput)); + "Command `%s` failed with output:%n%n%s", + command, + joinedOutput)); } return joinedOutput; } catch (InterruptedException | IOException e) { @@ -115,8 +117,9 @@ public static Optional getSymbolLink(Symbol symbol, Path relativeTo) { return Optional.empty(); } return Optional.of(format( - "./%s#%s", relativeToParent.relativize(Paths.get(symbol.getDefinitionFile())), linkId.get() - )); + "./%s#%s", + relativeToParent.relativize(Paths.get(symbol.getDefinitionFile())), + linkId.get())); } /** diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/SmithyDocPlugin.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/SmithyDocPlugin.java index 06b9045cbf1..038759a6f4c 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/SmithyDocPlugin.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/SmithyDocPlugin.java @@ -2,10 +2,8 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen; - import java.util.ArrayList; import java.util.List; import java.util.Optional; @@ -39,8 +37,7 @@ public String getName() { @Override public void execute(PluginContext pluginContext) { LOGGER.fine("Beginning documentation generation."); - CodegenDirector runner - = new CodegenDirector<>(); + CodegenDirector runner = new CodegenDirector<>(); runner.directedCodegen(new DirectedDocGen()); runner.integrationClass(DocIntegration.class); @@ -59,7 +56,8 @@ private ValidatedResult getValidatedModel(Model model) { // This will discover and apply suppressions from the model. Optional modelDecorator = new ModelBasedEventDecorator() - .createDecorator(model).getResult(); + .createDecorator(model) + .getResult(); if (modelDecorator.isPresent()) { eventDecorator = ValidationEventDecorator.compose(List.of(modelDecorator.get(), eventDecorator)); } diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/GeneratorUtils.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/GeneratorUtils.java index dd3bb2dab1c..15c75d1df0b 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/GeneratorUtils.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/GeneratorUtils.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.generators; import java.util.List; @@ -50,7 +49,8 @@ static void generateOperationListing( return; } - var parentLinkId = context.symbolProvider().toSymbol(shape) + var parentLinkId = context.symbolProvider() + .toSymbol(shape) .expectProperty(DocSymbolProvider.LINK_ID_PROPERTY, String.class); writer.openHeading("Operations", parentLinkId + "-operations"); writer.openList(ListType.UNORDERED); @@ -79,7 +79,8 @@ static void generateResourceListing( return; } - var parentLinkId = context.symbolProvider().toSymbol(shape) + var parentLinkId = context.symbolProvider() + .toSymbol(shape) .expectProperty(DocSymbolProvider.LINK_ID_PROPERTY, String.class); var heading = shape.isServiceShape() ? "Resources" : "Sub-Resources"; writer.openHeading(heading, parentLinkId + "-" + heading.toLowerCase(Locale.ENGLISH)); @@ -141,8 +142,9 @@ private static void writeProtocolSection( AtomicReference tabContents = new AtomicReference<>(); var tab = capture(writer, tabWriter -> { tabWriter.openTab(protocolSymbol.getName()); - tabContents.set(capture(tabWriter, w2 -> tabWriter.injectSection( - new ProtocolSection(context, shape, protocol)))); + tabContents.set(capture(tabWriter, + w2 -> tabWriter.injectSection( + new ProtocolSection(context, shape, protocol)))); tabWriter.closeTab(); }); diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/MemberGenerator.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/MemberGenerator.java index d804559a1d2..169e232a71c 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/MemberGenerator.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/MemberGenerator.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.generators; import java.util.Collection; @@ -141,10 +140,12 @@ private Collection getMembers() { return switch (listingType) { case INPUT -> context.model() .expectShape(shape.asOperationShape().get().getInputShape()) - .getAllMembers().values(); + .getAllMembers() + .values(); case OUTPUT -> context.model() .expectShape(shape.asOperationShape().get().getOutputShape()) - .getAllMembers().values(); + .getAllMembers() + .values(); case RESOURCE_IDENTIFIERS -> synthesizeResourceMembers(shape.asResourceShape().get().getIdentifiers()); case RESOURCE_PROPERTIES -> synthesizeResourceMembers(shape.asResourceShape().get().getProperties()); default -> shape.getAllMembers().values(); @@ -154,7 +155,8 @@ private Collection getMembers() { // Resource identifiers and properties aren't actually members, but they're close // enough that we can treat them like they are for the purposes of the doc generator. private List synthesizeResourceMembers(Map properties) { - return properties.entrySet().stream() + return properties.entrySet() + .stream() .map(entry -> MemberShape.builder() .id(shape.getId().withMember(entry.getKey())) .target(entry.getValue()) @@ -236,7 +238,9 @@ private static class MemberTypeVisitor extends ShapeVisitor.Default { @Override protected Void getDefault(Shape shape) { throw new CodegenException(String.format( - "Unexpected member %s of type %s", shape.getId(), shape.getType())); + "Unexpected member %s of type %s", + shape.getId(), + shape.getType())); } @Override diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/OperationGenerator.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/OperationGenerator.java index b8b73650858..655b16357a0 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/OperationGenerator.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/OperationGenerator.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.generators; import java.util.List; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/ResourceGenerator.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/ResourceGenerator.java index 61877863bbd..46c6612cf7a 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/ResourceGenerator.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/ResourceGenerator.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.generators; import java.util.HashSet; @@ -116,7 +115,9 @@ public void accept(DocGenerationContext context, ResourceShape resource) { new MemberGenerator(context, writer, resource, MemberListingType.RESOURCE_IDENTIFIERS).run(); new MemberGenerator(context, writer, resource, MemberListingType.RESOURCE_PROPERTIES).run(); - var subResources = resource.getResources().stream().sorted() + var subResources = resource.getResources() + .stream() + .sorted() .map(id -> context.model().expectShape(id, ResourceShape.class)) .toList(); GeneratorUtils.generateResourceListing(context, writer, resource, subResources); @@ -125,7 +126,8 @@ public void accept(DocGenerationContext context, ResourceShape resource) { var operationIds = new HashSet<>(resource.getOperations()); operationIds.addAll(resource.getCollectionOperations()); - var operations = operationIds.stream().sorted() + var operations = operationIds.stream() + .sorted() .map(id -> context.model().expectShape(id, OperationShape.class)) .toList(); GeneratorUtils.generateOperationListing(context, writer, resource, operations); @@ -141,7 +143,8 @@ private void generateLifecycleDocs(DocGenerationContext context, DocWriter write writer.popState(); return; } - var linkId = context.symbolProvider().toSymbol(resource) + var linkId = context.symbolProvider() + .toSymbol(resource) .expectProperty(DocSymbolProvider.LINK_ID_PROPERTY, String.class); writer.openHeading("Lifecycle Operations", linkId + "-lifecycle-operations"); writer.openDefinitionList(); diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/ServiceGenerator.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/ServiceGenerator.java index b221975a5ed..413f5d25ffa 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/ServiceGenerator.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/ServiceGenerator.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.generators; import java.util.function.Consumer; @@ -122,8 +121,9 @@ private void writeAuthSection(DocGenerationContext context, DocWriter writer, Se writer.openHeading("Auth"); var index = ServiceIndex.of(context.model()); - writer.putContext("optional", index.getEffectiveAuthSchemes(service, AuthSchemeMode.NO_AUTH_AWARE) - .containsKey(NoAuthTrait.ID)); + writer.putContext("optional", + index.getEffectiveAuthSchemes(service, AuthSchemeMode.NO_AUTH_AWARE) + .containsKey(NoAuthTrait.ID)); writer.putContext("multipleSchemes", authSchemes.size() > 1); writer.write(""" Operations on the service ${?optional}may optionally${/optional}${^optional}MUST${/optional} \ diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/StructuredShapeGenerator.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/StructuredShapeGenerator.java index 27c70c1e927..a2f47a116ef 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/StructuredShapeGenerator.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/generators/StructuredShapeGenerator.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.generators; import java.util.function.BiConsumer; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/integrations/BuiltinsIntegration.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/integrations/BuiltinsIntegration.java index 9275a78d61d..a2b86cbd729 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/integrations/BuiltinsIntegration.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/integrations/BuiltinsIntegration.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.integrations; import java.util.List; @@ -83,13 +82,13 @@ public byte priority() { @Override public List docFormats(DocSettings settings) { return List.of( - new DocFormat("markdown", ".md", new MarkdownWriter.Factory()) - ); + new DocFormat("markdown", ".md", new MarkdownWriter.Factory())); } @Override public List> interceptors( - DocGenerationContext context) { + DocGenerationContext context + ) { // Due to the way that interceptors work, the elements at the bottom of the list will // be called last. Since most of these append data to their sections, that means that // the ones at the end will be at the top of the rendered pages. Therefore, interceptors @@ -138,7 +137,6 @@ public List> interce new DeprecatedInterceptor(), new RecommendedInterceptor(), new NullabilityInterceptor(), - new SensitiveInterceptor() - ); + new SensitiveInterceptor()); } } diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/integrations/SphinxIntegration.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/integrations/SphinxIntegration.java index e808fd2a0b0..f632da6fde2 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/integrations/SphinxIntegration.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/integrations/SphinxIntegration.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.integrations; import static java.lang.String.format; @@ -101,11 +100,9 @@ public final class SphinxIntegration implements DocIntegration { private static final List BASE_EXTENSIONS = List.of( "sphinx_inline_tabs", "sphinx_copybutton", - "sphinx_design" - ); + "sphinx_design"); private static final List MARKDOWN_EXTENSIONS = List.of( - "myst_parser" - ); + "myst_parser"); private SphinxSettings settings = SphinxSettings.fromNode(Node.objectNode()); @@ -135,17 +132,15 @@ public void configure(DocSettings settings, ObjectNode integrationSettings) { @Override public List docFormats(DocSettings settings) { return List.of( - new DocFormat(MARKDOWN_FORMAT, ".md", new SphinxMarkdownWriter.Factory()) - ); + new DocFormat(MARKDOWN_FORMAT, ".md", new SphinxMarkdownWriter.Factory())); } @Override public void customize(DocGenerationContext context) { if (!FORMATS.contains(context.docFormat().name())) { LOGGER.finest(format( - "Format %s is not a Sphinx-compatible format, skipping Sphinx project setup.", - context.docFormat().name() - )); + "Format %s is not a Sphinx-compatible format, skipping Sphinx project setup.", + context.docFormat().name())); return; } LOGGER.info("Generating Sphinx project files."); @@ -235,67 +230,67 @@ private void writeMakefile(DocGenerationContext context) { context.writerDelegator().useFileWriter("Makefile", writer -> { writer.pushState(new MakefileSection(context)); writer.writeWithNoFormatting(""" - # Minimal makefile for Sphinx documentation - # You can set these variables from the command line, and also - # from the environment for the first two. - SPHINXOPTS ?= - SPHINXBUILD ?= sphinx-build - SOURCEDIR = content - BUILDDIR = build - - # Put it first so that "make" without argument is like "make help". - help: - \t@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - - .PHONY: help Makefile - - # Catch-all target: route all unknown targets to Sphinx using the new - # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). - %: Makefile - \t@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - """); + # Minimal makefile for Sphinx documentation + # You can set these variables from the command line, and also + # from the environment for the first two. + SPHINXOPTS ?= + SPHINXBUILD ?= sphinx-build + SOURCEDIR = content + BUILDDIR = build + + # Put it first so that "make" without argument is like "make help". + help: + \t@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + + .PHONY: help Makefile + + # Catch-all target: route all unknown targets to Sphinx using the new + # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). + %: Makefile + \t@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + """); writer.popState(); }); context.writerDelegator().useFileWriter("make.bat", writer -> { writer.pushState(new WindowsMakeSection(context)); writer.write(""" - @ECHO OFF - - pushd %~dp0 - - REM Command file for Sphinx documentation - - if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build - ) - set SOURCEDIR=content - set BUILDDIR=build - - %SPHINXBUILD% >NUL 2>NUL - if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.https://www.sphinx-doc.org/ - exit /b 1 - ) - - if "%1" == "" goto help - - %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - goto end - - :help - %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - - :end - popd - """); + @ECHO OFF + + pushd %~dp0 + + REM Command file for Sphinx documentation + + if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build + ) + set SOURCEDIR=content + set BUILDDIR=build + + %SPHINXBUILD% >NUL 2>NUL + if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 + ) + + if "%1" == "" goto help + + %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + goto end + + :help + %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + + :end + popd + """); writer.popState(); }); } @@ -337,31 +332,30 @@ private void runSphinx(DocGenerationContext context) { runCommand("./venv/bin/sphinx-build -M " + settings.format() + " content build", baseDir); System.out.printf(normalizeNewlines(""" - Successfully built HTML docs. They can be found in "%1$s". - - Other output formats can also be built. A python virtual environment \ - has been created at "%2$s" containing the build tools needed for \ - manually building the docs in other formats. See the virtual \ - environment docs for information on how to activate it: \ - https://docs.python.org/3/library/venv.html#how-venvs-work - - Once the environment is activated, run `make %4$s` from "%3$s" to \ - to build the docs, substituting %4$s for whatever format you wish \ - to build. - - To build the docs without activating the virtual environment, simply \ - run `./venv/bin/sphinx-build -M %4$s content build` from "%3$s", \ - similarly substituting %4$s for your desired format. - - See sphinx docs for other output formats you can choose: \ - https://www.sphinx-doc.org/en/master/usage/builders/index.html - - """), - baseDir.resolve("build/" + settings.format()), - baseDir.resolve("venv"), - baseDir, - settings.format() - ); + Successfully built HTML docs. They can be found in "%1$s". + + Other output formats can also be built. A python virtual environment \ + has been created at "%2$s" containing the build tools needed for \ + manually building the docs in other formats. See the virtual \ + environment docs for information on how to activate it: \ + https://docs.python.org/3/library/venv.html#how-venvs-work + + Once the environment is activated, run `make %4$s` from "%3$s" to \ + to build the docs, substituting %4$s for whatever format you wish \ + to build. + + To build the docs without activating the virtual environment, simply \ + run `./venv/bin/sphinx-build -M %4$s content build` from "%3$s", \ + similarly substituting %4$s for your desired format. + + See sphinx docs for other output formats you can choose: \ + https://www.sphinx-doc.org/en/master/usage/builders/index.html + + """), + baseDir.resolve("build/" + settings.format()), + baseDir.resolve("venv"), + baseDir, + settings.format()); } catch (CodegenException e) { LOGGER.warning("Unable to automatically build HTML docs: " + e); logManualBuildInstructions(context); @@ -371,22 +365,21 @@ private void runSphinx(DocGenerationContext context) { private void logManualBuildInstructions(DocGenerationContext context) { // TODO: try to get this printed out in the projection section System.out.printf(normalizeNewlines(""" - To build the HTML docs manually, you need to first install the python \ - dependencies. These can be found in the `requirements.txt` file in \ - "%1$s". The easiest way to install these is by running `pip install \ - -r requirements.txt`. Depending on your environment, you may need to \ - instead install them from your system package manager, or another \ - source. - - Once the dependencies are installed, run `make %2$s` from \ - "%1$s". Other output formats can also be built. See sphinx docs for \ - other output formats: \ - https://www.sphinx-doc.org/en/master/usage/builders/index.html - - """), - context.fileManifest().getBaseDir(), - settings.format() - ); + To build the HTML docs manually, you need to first install the python \ + dependencies. These can be found in the `requirements.txt` file in \ + "%1$s". The easiest way to install these is by running `pip install \ + -r requirements.txt`. Depending on your environment, you may need to \ + instead install them from your system package manager, or another \ + source. + + Once the dependencies are installed, run `make %2$s` from \ + "%1$s". Other output formats can also be built. See sphinx docs for \ + other output formats: \ + https://www.sphinx-doc.org/en/master/usage/builders/index.html + + """), + context.fileManifest().getBaseDir(), + settings.format()); } private void writeIndexes(DocGenerationContext context) { @@ -408,7 +401,8 @@ private void writeIndexes(DocGenerationContext context) { var service = context.model().expectShape(context.settings().service(), ServiceShape.class); var serviceSymbol = context.symbolProvider().toSymbol(service); var serivceDirectory = Paths.get(serviceSymbol.getDefinitionFile()).getParent(); - var sourceDirectories = directories.keySet().stream() + var sourceDirectories = directories.keySet() + .stream() .filter(path -> !path.equals(context.fileManifest().resolvePath(serivceDirectory))) .map(Path::getFileName) .map(Object::toString) @@ -523,8 +517,7 @@ public record SphinxSettings( String theme, List extraDependencies, List extraExtensions, - boolean autoBuild - ) { + boolean autoBuild) { /** * Load the settings from an {@code ObjectNode}. * @@ -547,8 +540,7 @@ public static SphinxSettings fromNode(ObjectNode node) { node.getStringMemberOrDefault("theme", "furo"), extraDependencies, extraExtensions, - node.getBooleanMemberOrDefault("autoBuild", true) - ); + node.getBooleanMemberOrDefault("autoBuild", true)); } } } diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/ApiKeyAuthInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/ApiKeyAuthInterceptor.java index 6418a453a92..14fce3f93e4 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/ApiKeyAuthInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/ApiKeyAuthInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ShapeDetailsSection; @@ -19,8 +18,8 @@ @SmithyInternalApi public final class ApiKeyAuthInterceptor implements CodeInterceptor { private static final Pair AUTH_HEADER_REF = Pair.of( - "Authorization header", "https://datatracker.ietf.org/doc/html/rfc9110.html#section-11.4" - ); + "Authorization header", + "https://datatracker.ietf.org/doc/html/rfc9110.html#section-11.4"); @Override public Class sectionType() { diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/DefaultValueInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/DefaultValueInterceptor.java index e5a90200af5..394295d6f74 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/DefaultValueInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/DefaultValueInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ShapeSubheadingSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/DeprecatedInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/DeprecatedInterceptor.java index 7a0a06ad993..8a83726c899 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/DeprecatedInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/DeprecatedInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ShapeSubheadingSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/EndpointInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/EndpointInterceptor.java index f84ef0a8091..9d3f692470d 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/EndpointInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/EndpointInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ProtocolSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/ErrorFaultInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/ErrorFaultInterceptor.java index c00fbb21942..a97e86f4472 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/ErrorFaultInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/ErrorFaultInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ShapeSubheadingSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/ExternalDocsInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/ExternalDocsInterceptor.java index 9f8cbba6b16..89897b2e6b9 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/ExternalDocsInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/ExternalDocsInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ShapeDetailsSection; @@ -34,7 +33,9 @@ public boolean isIntercepted(ShapeDetailsSection section) { public void write(DocWriter writer, String previousText, ShapeDetailsSection section) { var trait = section.shape().getMemberTrait(section.context().model(), ExternalDocumentationTrait.class).get(); writer.openAdmonition(NoticeType.INFO); - trait.getUrls().entrySet().stream() + trait.getUrls() + .entrySet() + .stream() .map(entry -> Pair.of(entry.getKey(), entry.getValue())) .forEach(pair -> writer.write("$R\n", pair)); writer.closeAdmonition(); diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HostLabelInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HostLabelInterceptor.java index ea94c857630..4d1ee210001 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HostLabelInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HostLabelInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ProtocolSection; @@ -18,7 +17,7 @@ * hostLabel trait if the protocol supports it.. */ @SmithyInternalApi -public final class HostLabelInterceptor extends ProtocolTraitInterceptor { +public final class HostLabelInterceptor extends ProtocolTraitInterceptor { @Override protected Class getTraitClass() { return HostLabelTrait.class; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpChecksumRequiredInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpChecksumRequiredInterceptor.java index 3ee07121873..fa9f8459f56 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpChecksumRequiredInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpChecksumRequiredInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ProtocolSection; @@ -21,8 +20,8 @@ @SmithyInternalApi public final class HttpChecksumRequiredInterceptor extends ProtocolTraitInterceptor { private static final Pair CONTENT_MD5 = Pair.of( - "Content-MD5", "https://datatracker.ietf.org/doc/html/rfc1864.html" - ); + "Content-MD5", + "https://datatracker.ietf.org/doc/html/rfc1864.html"); @Override protected Class getTraitClass() { diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpErrorInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpErrorInterceptor.java index f294a94a785..295ab32a011 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpErrorInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpErrorInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ProtocolSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpHeaderInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpHeaderInterceptor.java index b194264dbe7..6bda488f628 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpHeaderInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpHeaderInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ProtocolSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpInterceptor.java index 58310830f49..a4198f54fe8 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ProtocolSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpLabelInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpLabelInterceptor.java index 4b0955ba47f..1afcd3982dd 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpLabelInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpLabelInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ProtocolSection; @@ -41,11 +40,14 @@ public boolean isIntercepted(ProtocolSection section) { @Override void write(DocWriter writer, String previousText, ProtocolSection section, HttpLabelTrait trait) { var index = OperationIndex.of(section.context().model()); - writer.putContext("greedy", index.getInputBindings(section.shape()).stream().findFirst() - .map(operation -> operation.expectTrait(HttpTrait.class)) - .flatMap(httpTrait -> httpTrait.getUri().getGreedyLabel()) - .map(segment -> segment.getContent().equals(section.shape().getId().getName())) - .orElse(false)); + writer.putContext("greedy", + index.getInputBindings(section.shape()) + .stream() + .findFirst() + .map(operation -> operation.expectTrait(HttpTrait.class)) + .flatMap(httpTrait -> httpTrait.getUri().getGreedyLabel()) + .map(segment -> segment.getContent().equals(section.shape().getId().getName())) + .orElse(false)); var segment = "{" + section.shape().getId().getName() + "}"; writer.write(""" This is bound to the path of the URI. Its value should be URI-escaped and \ diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpPayloadInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpPayloadInterceptor.java index 56ef9df1fb8..5df8dc62e1f 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpPayloadInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpPayloadInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ProtocolSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpPrefixHeadersInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpPrefixHeadersInterceptor.java index dfbd583c03e..874c010db45 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpPrefixHeadersInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpPrefixHeadersInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ProtocolSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpQueryInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpQueryInterceptor.java index e369dc102a9..5f69e13dd4b 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpQueryInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpQueryInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ProtocolSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpQueryParamsInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpQueryParamsInterceptor.java index ddbf4c2e1e0..9fe1afc51ec 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpQueryParamsInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpQueryParamsInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ProtocolSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpResponseCodeInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpResponseCodeInterceptor.java index 4f2c5114124..aa8929b5a29 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpResponseCodeInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/HttpResponseCodeInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ProtocolSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/IdempotencyInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/IdempotencyInterceptor.java index 516599a79a8..2aff0579aa5 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/IdempotencyInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/IdempotencyInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import java.util.Optional; @@ -27,11 +26,11 @@ @SmithyInternalApi public final class IdempotencyInterceptor implements CodeInterceptor { private static final Pair IDEMPOTENT_REF = Pair.of( - "idempotent", "https://datatracker.ietf.org/doc/html/rfc7231.html#section-4.2.2" - ); + "idempotent", + "https://datatracker.ietf.org/doc/html/rfc7231.html#section-4.2.2"); private static final Pair UUID_REF = Pair.of( - "UUID", "https://tools.ietf.org/html/rfc4122.html" - ); + "UUID", + "https://tools.ietf.org/html/rfc4122.html"); @Override public Class sectionType() { diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/InternalInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/InternalInterceptor.java index d021b5bc150..924f9030bd7 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/InternalInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/InternalInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import java.util.logging.Logger; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/JsonNameInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/JsonNameInterceptor.java index b8c8e15c78e..73560ae09af 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/JsonNameInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/JsonNameInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ProtocolSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/LengthInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/LengthInterceptor.java index e17fb7a29b0..42c8fcaf031 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/LengthInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/LengthInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ShapeSubheadingSection; @@ -21,8 +20,8 @@ @SmithyInternalApi public final class LengthInterceptor implements CodeInterceptor { private static final Pair UNICODE_SCALAR_VALUE_REFERENCE = Pair.of( - "Unicode scalar values", "https://www.unicode.org/glossary/#unicode_scalar_value" - ); + "Unicode scalar values", + "https://www.unicode.org/glossary/#unicode_scalar_value"); @Override public Class sectionType() { diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/MediaTypeInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/MediaTypeInterceptor.java index 80b73fcbc7b..ab3a69a5b61 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/MediaTypeInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/MediaTypeInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ShapeSubheadingSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/NoReplaceBindingInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/NoReplaceBindingInterceptor.java index a9986a0b224..9fb21c1774c 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/NoReplaceBindingInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/NoReplaceBindingInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.DocGenerationContext; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/NoReplaceInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/NoReplaceInterceptor.java index 733fa9c68e6..8699b845acb 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/NoReplaceInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/NoReplaceInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import java.util.Optional; @@ -28,7 +27,7 @@ abstract class NoReplaceInterceptor implements CodeInterc @Override public boolean isIntercepted(S section) { var shape = getShape(section); - var resource = getResource(getContext(section), shape); + var resource = getResource(getContext(section), shape); return resource.isPresent() && resource.get().hasTrait(NoReplaceTrait.class) && resource.get().getPut().map(put -> put.equals(shape.getId())).orElse(false); @@ -67,7 +66,6 @@ public void write( */ abstract Shape getShape(S section); - /** * Extracts the context for the section. * @param section the section to extract the context from. diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/NoReplaceOperationInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/NoReplaceOperationInterceptor.java index 4bdaafa0534..95d19502de3 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/NoReplaceOperationInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/NoReplaceOperationInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.DocGenerationContext; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/NullabilityInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/NullabilityInterceptor.java index 38935c7fffe..d09283d5b08 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/NullabilityInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/NullabilityInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ShapeSubheadingSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/OperationAuthInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/OperationAuthInterceptor.java index 6c278c23d3f..fd2b5795924 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/OperationAuthInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/OperationAuthInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import java.util.List; @@ -57,7 +56,6 @@ public void write(DocWriter writer, String previousText, ShapeDetailsSection sec var service = section.context().settings().service(); var operation = section.shape(); - var serviceAuth = DocgenUtils.getPrioritizedServiceAuth(section.context().model(), service); var operationAuth = List.copyOf( index.getEffectiveAuthSchemes(service, operation, AuthSchemeMode.MODELED).keySet()); diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/PaginationInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/PaginationInterceptor.java index c98db580918..6e4861909a5 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/PaginationInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/PaginationInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.codegen.core.SymbolReference; @@ -36,17 +35,19 @@ public void write(DocWriter writer, String previousText, ShapeDetailsSection sec var paginationInfo = paginatedIndex.getPaginationInfo(service, section.shape()).get(); var symbolProvider = section.context().symbolProvider(); writer.putContext("size", paginationInfo.getPageSizeMember().map(symbolProvider::toSymbol)); - writer.putContext("inputToken", SymbolReference.builder() - .symbol(symbolProvider.toSymbol(paginationInfo.getInputTokenMember())) - .alias("input token") - .build()); + writer.putContext("inputToken", + SymbolReference.builder() + .symbol(symbolProvider.toSymbol(paginationInfo.getInputTokenMember())) + .alias("input token") + .build()); var outputTokenPath = paginationInfo.getOutputTokenMemberPath(); var outputToken = outputTokenPath.get(outputTokenPath.size() - 1); - writer.putContext("outputToken", SymbolReference.builder() - .symbol(symbolProvider.toSymbol(outputToken)) - .alias("output token") - .build()); + writer.putContext("outputToken", + SymbolReference.builder() + .symbol(symbolProvider.toSymbol(outputToken)) + .alias("output token") + .build()); writer.openAdmonition(NoticeType.IMPORTANT); writer.write(""" diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/PatternInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/PatternInterceptor.java index c68abda15d5..ecd11418c6d 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/PatternInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/PatternInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ShapeSubheadingSection; @@ -20,8 +19,8 @@ @SmithyInternalApi public final class PatternInterceptor implements CodeInterceptor { private static final Pair REGEX_REF = Pair.of( - "ECMA 262 regular expression", "https://262.ecma-international.org/8.0/#sec-patterns" - ); + "ECMA 262 regular expression", + "https://262.ecma-international.org/8.0/#sec-patterns"); @Override public Class sectionType() { diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/ProtocolTraitInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/ProtocolTraitInterceptor.java index c61bba7b350..562c12ff219 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/ProtocolTraitInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/ProtocolTraitInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ProtocolSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/RangeInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/RangeInterceptor.java index f4198e03493..218101499fa 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/RangeInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/RangeInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ShapeSubheadingSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/RecommendedInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/RecommendedInterceptor.java index 3f577de3c56..d5d10636aa6 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/RecommendedInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/RecommendedInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ShapeSubheadingSection; @@ -18,7 +17,7 @@ * recommended trait. */ @SmithyInternalApi -public final class RecommendedInterceptor implements CodeInterceptor { +public final class RecommendedInterceptor implements CodeInterceptor { @Override public Class sectionType() { return ShapeSubheadingSection.class; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/ReferencesInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/ReferencesInterceptor.java index ba037627cda..d8b0cd64827 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/ReferencesInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/ReferencesInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import java.util.LinkedHashMap; @@ -58,7 +57,8 @@ public void append(DocWriter writer, ShapeDetailsSection section) { var symbolProvider = section.context().symbolProvider(); var localRefs = getLocalReferences(section.context(), section.shape()); var externalRefs = section.context().settings().references(); - var serviceResources = TopDownIndex.of(model).getContainedResources(section.context().settings().service()) + var serviceResources = TopDownIndex.of(model) + .getContainedResources(section.context().settings().service()) .stream() .map(Shape::getId) .collect(Collectors.toSet()); @@ -108,7 +108,8 @@ private Set getLocalReferences(DocGenerationContext context, Shape sh var shapeRefs = shape.getMemberTrait(model, ReferencesTrait.class); var externalsRefs = context.settings().references(); - var serviceResources = TopDownIndex.of(model).getContainedResources(context.settings().service()) + var serviceResources = TopDownIndex.of(model) + .getContainedResources(context.settings().service()) .stream() .map(Shape::getId) .collect(Collectors.toSet()); @@ -122,7 +123,8 @@ private Set getLocalReferences(DocGenerationContext context, Shape sh LOGGER.warning(String.format(""" Unable to generate a reference link for `%s`, referenced by `%s`. Use the `references` \ map in the generator settings to add a reference link.""", - reference.getResource(), shape.getId())); + reference.getResource(), + shape.getId())); } } } diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/RequestCompressionInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/RequestCompressionInterceptor.java index dfb740996a9..163a75dbf8d 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/RequestCompressionInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/RequestCompressionInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import java.util.Optional; @@ -36,9 +35,10 @@ public void write(DocWriter writer, String previousText, ShapeDetailsSection sec writer.openAdmonition(NoticeType.IMPORTANT); // Have particular support for single-element lists. - writer.putContext("encoding", trait.getEncodings().size() == 1 - ? Optional.of(trait.getEncodings().get(0)) - : Optional.empty()); + writer.putContext("encoding", + trait.getEncodings().size() == 1 + ? Optional.of(trait.getEncodings().get(0)) + : Optional.empty()); writer.putContext("encodings", trait.getEncodings()); writer.write(""" diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/RetryableInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/RetryableInterceptor.java index 088f6a0a1b2..92146a6312e 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/RetryableInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/RetryableInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ShapeSubheadingSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/SensitiveInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/SensitiveInterceptor.java index 8f6c6e698f3..1f21bbf7b93 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/SensitiveInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/SensitiveInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ShapeSubheadingSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/SinceInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/SinceInterceptor.java index afcd6a9c699..7474fb58ccc 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/SinceInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/SinceInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ShapeSubheadingSection; @@ -18,7 +17,7 @@ * since trait. */ @SmithyInternalApi -public final class SinceInterceptor implements CodeInterceptor { +public final class SinceInterceptor implements CodeInterceptor { @Override public Class sectionType() { return ShapeSubheadingSection.class; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/SparseInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/SparseInterceptor.java index 11b64a89767..d7aa25cecdd 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/SparseInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/SparseInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import java.util.Locale; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/StreamingInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/StreamingInterceptor.java index 50202945f1d..b68361ab0c3 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/StreamingInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/StreamingInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ShapeDetailsSection; @@ -30,7 +29,8 @@ public boolean isIntercepted(ShapeDetailsSection section) { @Override public void append(DocWriter writer, ShapeDetailsSection section) { - var target = section.shape().asMemberShape() + var target = section.shape() + .asMemberShape() .map(member -> section.context().model().expectShape(member.getTarget())) .orElse(section.shape()); if (target.isBlobShape()) { diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/TimestampFormatInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/TimestampFormatInterceptor.java index eca3fe583c9..1672c3a32db 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/TimestampFormatInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/TimestampFormatInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ProtocolSection; @@ -19,11 +18,11 @@ @SmithyInternalApi public final class TimestampFormatInterceptor extends ProtocolTraitInterceptor { private static final Pair DATE_TIME_REF = Pair.of( - "RFC3339 date-time", "https://datatracker.ietf.org/doc/html/rfc3339.html#section-5.6" - ); + "RFC3339 date-time", + "https://datatracker.ietf.org/doc/html/rfc3339.html#section-5.6"); private static final Pair HTTP_DATE_REF = Pair.of( - "RFC7231 IMF-fixdate", "https://tools.ietf.org/html/rfc7231.html#section-7.1.1.1" - ); + "RFC7231 IMF-fixdate", + "https://tools.ietf.org/html/rfc7231.html#section-7.1.1.1"); @Override protected Class getTraitClass() { diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/UniqueItemsInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/UniqueItemsInterceptor.java index 5f0041c4fa0..92ddf4f1530 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/UniqueItemsInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/UniqueItemsInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ShapeSubheadingSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/UnstableInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/UnstableInterceptor.java index e9aee183938..c21d2cd3d15 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/UnstableInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/UnstableInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ShapeSubheadingSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/XmlAttributeInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/XmlAttributeInterceptor.java index 5e1e7134b66..23214239f47 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/XmlAttributeInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/XmlAttributeInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ProtocolSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/XmlFlattenedInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/XmlFlattenedInterceptor.java index 66c2aa6c572..2e213a70bd7 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/XmlFlattenedInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/XmlFlattenedInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.DocGenerationContext; @@ -24,17 +23,17 @@ @SmithyInternalApi public class XmlFlattenedInterceptor implements CodeInterceptor { private static final Pair WRAPPED_LIST_REF = Pair.of( - "wrapped", "https://smithy.io/2.0/spec/protocol-traits.html#wrapped-list-serialization" - ); + "wrapped", + "https://smithy.io/2.0/spec/protocol-traits.html#wrapped-list-serialization"); private static final Pair FLAT_LIST_REF = Pair.of( - "flat", "https://smithy.io/2.0/spec/protocol-traits.html#flattened-list-serialization" - ); + "flat", + "https://smithy.io/2.0/spec/protocol-traits.html#flattened-list-serialization"); private static final Pair WRAPPED_MAP_REF = Pair.of( - "wrapped", "https://smithy.io/2.0/spec/protocol-traits.html#wrapped-map-serialization" - ); + "wrapped", + "https://smithy.io/2.0/spec/protocol-traits.html#wrapped-map-serialization"); private static final Pair FLAT_MAP_REF = Pair.of( - "flat", "https://smithy.io/2.0/spec/protocol-traits.html#flattened-map-serialization" - ); + "flat", + "https://smithy.io/2.0/spec/protocol-traits.html#flattened-map-serialization"); @Override public Class sectionType() { diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/XmlNameInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/XmlNameInterceptor.java index 0d5ea3b1df7..0fd16263ba2 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/XmlNameInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/XmlNameInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ProtocolSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/XmlNamespaceInterceptor.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/XmlNamespaceInterceptor.java index 13d902f3705..3dabf1ae460 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/XmlNamespaceInterceptor.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/interceptors/XmlNamespaceInterceptor.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.interceptors; import software.amazon.smithy.docgen.sections.ProtocolSection; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/AuthSection.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/AuthSection.java index 690cb276ef2..0e941c8b5b1 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/AuthSection.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/AuthSection.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.sections; import software.amazon.smithy.docgen.DocGenerationContext; @@ -36,5 +35,4 @@ * example of adding details to an auth trait's docs based on its values. */ @SmithyUnstableApi -public record AuthSection(DocGenerationContext context, ServiceShape service) implements CodeSection { -} +public record AuthSection(DocGenerationContext context, ServiceShape service) implements CodeSection {} diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/BoundOperationSection.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/BoundOperationSection.java index 44e0151d7ae..1efd6884984 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/BoundOperationSection.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/BoundOperationSection.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.sections; import software.amazon.smithy.docgen.DocGenerationContext; @@ -37,6 +36,4 @@ public record BoundOperationSection( DocGenerationContext context, EntityShape container, - OperationShape operation -) implements CodeSection { -} + OperationShape operation) implements CodeSection {} diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/BoundOperationsSection.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/BoundOperationsSection.java index e65f790a0fd..9de5a0f1a8e 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/BoundOperationsSection.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/BoundOperationsSection.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.sections; import java.util.List; @@ -37,6 +36,4 @@ public record BoundOperationsSection( DocGenerationContext context, EntityShape container, - List operations -) implements CodeSection { -} + List operations) implements CodeSection {} diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/BoundResourceSection.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/BoundResourceSection.java index 4fcc9232a4b..85079ef222b 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/BoundResourceSection.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/BoundResourceSection.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.sections; import software.amazon.smithy.docgen.DocGenerationContext; @@ -36,6 +35,4 @@ public record BoundResourceSection( DocGenerationContext context, EntityShape container, - ResourceShape resource -) implements CodeSection { -} + ResourceShape resource) implements CodeSection {} diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/BoundResourcesSection.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/BoundResourcesSection.java index 7d14c4916b9..eae09ac8b71 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/BoundResourcesSection.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/BoundResourcesSection.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.sections; import java.util.List; @@ -36,6 +35,4 @@ public record BoundResourcesSection( DocGenerationContext context, EntityShape container, - List resources -) implements CodeSection { -} + List resources) implements CodeSection {} diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ErrorsSection.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ErrorsSection.java index cf79e505a1f..004c172d686 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ErrorsSection.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ErrorsSection.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.sections; import software.amazon.smithy.docgen.DocGenerationContext; @@ -26,5 +25,4 @@ * @see OperationGenerator */ @SmithyUnstableApi -public record ErrorsSection(DocGenerationContext context, Shape shape) implements CodeSection { -} +public record ErrorsSection(DocGenerationContext context, Shape shape) implements CodeSection {} diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ExampleSection.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ExampleSection.java index 3c5f17d9101..32b2a7b4095 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ExampleSection.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ExampleSection.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.sections; import software.amazon.smithy.docgen.DocGenerationContext; @@ -29,6 +28,4 @@ public record ExampleSection( DocGenerationContext context, OperationShape operation, - Example example -) implements CodeSection { -} + Example example) implements CodeSection {} diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ExamplesSection.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ExamplesSection.java index 457edc10aa2..32825ad548b 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ExamplesSection.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ExamplesSection.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.sections; import java.util.List; @@ -31,6 +30,4 @@ public record ExamplesSection( DocGenerationContext context, OperationShape operation, - List examples -) implements CodeSection { -} + List examples) implements CodeSection {} diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/LifecycleOperationSection.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/LifecycleOperationSection.java index 61ad8272dfd..7d2d27468c7 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/LifecycleOperationSection.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/LifecycleOperationSection.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.sections; import software.amazon.smithy.docgen.DocGenerationContext; @@ -34,8 +33,7 @@ public record LifecycleOperationSection( DocGenerationContext context, ResourceShape resource, OperationShape operation, - LifecycleType lifecycleType -) implements CodeSection { + LifecycleType lifecycleType) implements CodeSection { // smithy-model doesn't have a pared-down enum for these lifecycle types, instead // using the broader RelationshipType. That's fine for smithy-model, which needs diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/LifecycleSection.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/LifecycleSection.java index 2550d120761..87e4f740478 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/LifecycleSection.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/LifecycleSection.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.sections; import software.amazon.smithy.docgen.DocGenerationContext; @@ -27,5 +26,4 @@ * about other sections present on the documentation pages for resrouces. */ @SmithyUnstableApi -public record LifecycleSection(DocGenerationContext context, ResourceShape resource) implements CodeSection { -} +public record LifecycleSection(DocGenerationContext context, ResourceShape resource) implements CodeSection {} diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/MemberSection.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/MemberSection.java index e82fba19450..0dbbe7fd09c 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/MemberSection.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/MemberSection.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.sections; import software.amazon.smithy.docgen.DocGenerationContext; @@ -20,5 +19,4 @@ * @see ShapeSubheadingSection to add context immediately before the member's docs. */ @SmithyUnstableApi -public record MemberSection(DocGenerationContext context, MemberShape member) implements CodeSection { -} +public record MemberSection(DocGenerationContext context, MemberShape member) implements CodeSection {} diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ProtocolSection.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ProtocolSection.java index 634eef95c80..4029e1e268b 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ProtocolSection.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ProtocolSection.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.sections; import software.amazon.smithy.docgen.DocGenerationContext; @@ -26,6 +25,4 @@ public record ProtocolSection( DocGenerationContext context, Shape shape, - ShapeId protocol -) implements CodeSection { -} + ShapeId protocol) implements CodeSection {} diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ProtocolsSection.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ProtocolsSection.java index 2964432a162..81ae3e16f48 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ProtocolsSection.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ProtocolsSection.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.sections; import software.amazon.smithy.docgen.DocGenerationContext; @@ -26,6 +25,4 @@ @SmithyUnstableApi public record ProtocolsSection( DocGenerationContext context, - Shape shape -) implements CodeSection { -} + Shape shape) implements CodeSection {} diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ShapeDetailsSection.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ShapeDetailsSection.java index 64f68a1e15c..0010b52737e 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ShapeDetailsSection.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ShapeDetailsSection.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.sections; import software.amazon.smithy.docgen.DocGenerationContext; @@ -20,5 +19,4 @@ * @see ShapeSubheadingSection to inject docs before modeled documentation. */ @SmithyUnstableApi -public record ShapeDetailsSection(DocGenerationContext context, Shape shape) implements CodeSection { -} +public record ShapeDetailsSection(DocGenerationContext context, Shape shape) implements CodeSection {} diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ShapeMembersSection.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ShapeMembersSection.java index 1d581a12341..f78f01ad4c8 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ShapeMembersSection.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ShapeMembersSection.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.sections; import java.util.Collection; @@ -28,6 +27,4 @@ public record ShapeMembersSection( DocGenerationContext context, Shape shape, Collection members, - MemberListingType listingType -) implements CodeSection { -} + MemberListingType listingType) implements CodeSection {} diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ShapeSection.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ShapeSection.java index 1a8d8b877e1..b203f11764d 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ShapeSection.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ShapeSection.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.sections; import software.amazon.smithy.docgen.DocGenerationContext; @@ -21,5 +20,4 @@ * @see MemberSection to modify the documentation for an individual shape member. */ @SmithyUnstableApi -public record ShapeSection(DocGenerationContext context, Shape shape) implements CodeSection { -} +public record ShapeSection(DocGenerationContext context, Shape shape) implements CodeSection {} diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ShapeSubheadingSection.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ShapeSubheadingSection.java index 847ec646a64..829e981be46 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ShapeSubheadingSection.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/ShapeSubheadingSection.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.sections; import software.amazon.smithy.docgen.DocGenerationContext; @@ -20,5 +19,4 @@ * @see ShapeDetailsSection to inject docs after modeled documentation. */ @SmithyUnstableApi -public record ShapeSubheadingSection(DocGenerationContext context, Shape shape) implements CodeSection { -} +public record ShapeSubheadingSection(DocGenerationContext context, Shape shape) implements CodeSection {} diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/sphinx/ConfSection.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/sphinx/ConfSection.java index 21e22a0a3fa..3021651d635 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/sphinx/ConfSection.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/sphinx/ConfSection.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.sections.sphinx; import java.util.Set; @@ -18,5 +17,4 @@ * @param extensions Extensions needed to generate documentation. */ @SmithyUnstableApi -public record ConfSection(DocGenerationContext context, Set extensions) implements CodeSection { -} +public record ConfSection(DocGenerationContext context, Set extensions) implements CodeSection {} diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/sphinx/IndexSection.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/sphinx/IndexSection.java index 51fd5e706ae..ed91dcd4767 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/sphinx/IndexSection.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/sphinx/IndexSection.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.sections.sphinx; import java.nio.file.Path; @@ -25,6 +24,4 @@ public record IndexSection( DocGenerationContext context, Path directory, - Set sourceFiles -) implements CodeSection { -} + Set sourceFiles) implements CodeSection {} diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/sphinx/MakefileSection.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/sphinx/MakefileSection.java index be4c1e63e0e..2e37f737cd2 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/sphinx/MakefileSection.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/sphinx/MakefileSection.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.sections.sphinx; import software.amazon.smithy.docgen.DocGenerationContext; @@ -14,5 +13,4 @@ * @param context The context used to generate documentation. */ @SmithyUnstableApi -public record MakefileSection(DocGenerationContext context) implements CodeSection { -} +public record MakefileSection(DocGenerationContext context) implements CodeSection {} diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/sphinx/RequirementsSection.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/sphinx/RequirementsSection.java index 58988c0418a..bf76372351c 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/sphinx/RequirementsSection.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/sphinx/RequirementsSection.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.sections.sphinx; import java.util.Set; @@ -20,5 +19,4 @@ * @param requirements The requirements as a list of PEP 508 strings. */ @SmithyUnstableApi -public record RequirementsSection(DocGenerationContext context, Set requirements) implements CodeSection { -} +public record RequirementsSection(DocGenerationContext context, Set requirements) implements CodeSection {} diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/sphinx/WindowsMakeSection.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/sphinx/WindowsMakeSection.java index 6916c8cd1e4..9c7aaac7dfe 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/sphinx/WindowsMakeSection.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/sections/sphinx/WindowsMakeSection.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.sections.sphinx; import software.amazon.smithy.docgen.DocGenerationContext; @@ -14,5 +13,4 @@ * @param context The context used to generate documentation. */ @SmithyUnstableApi -public record WindowsMakeSection(DocGenerationContext context) implements CodeSection { -} +public record WindowsMakeSection(DocGenerationContext context) implements CodeSection {} diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/validation/DocValidationEventDecorator.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/validation/DocValidationEventDecorator.java index 12676fa42dd..e39643a6261 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/validation/DocValidationEventDecorator.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/validation/DocValidationEventDecorator.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.validation; import software.amazon.smithy.model.traits.UnitTypeTrait; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/writers/DocImportContainer.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/writers/DocImportContainer.java index 00d35d79cc6..427933afe07 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/writers/DocImportContainer.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/writers/DocImportContainer.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.writers; import software.amazon.smithy.codegen.core.ImportContainer; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/writers/DocWriter.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/writers/DocWriter.java index a7233c2a78d..e0cf6440969 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/writers/DocWriter.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/writers/DocWriter.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.writers; import java.util.function.Consumer; @@ -108,7 +107,8 @@ public DocWriter(DocImportContainer importContainer, String filename) { * @return returns the writer. */ public DocWriter writeShapeDocs(Shape shape, Model model) { - var documentation = shape.getMemberTrait(model, DocumentationTrait.class).map(StringTrait::getValue) + var documentation = shape.getMemberTrait(model, DocumentationTrait.class) + .map(StringTrait::getValue) .orElse("Placeholder documentation for `" + shape.getId() + "`"); writeCommonMark(documentation.replace("$", "$$")); return this; @@ -140,9 +140,8 @@ public DocWriter openHeading(String content) { headingDepth++; if (headingDepth > MAX_HEADING_DEPTH) { throw new CodegenException(String.format( - "Tried opening a heading nested more deeply than the max depth of %d.", - MAX_HEADING_DEPTH - )); + "Tried opening a heading nested more deeply than the max depth of %d.", + MAX_HEADING_DEPTH)); } return openHeading(content, headingDepth); } @@ -184,8 +183,7 @@ public DocWriter closeHeading() { headingDepth--; if (headingDepth < 0) { throw new CodegenException( - "Attempted to close a heading when at the base heading level." - ); + "Attempted to close a heading when at the base heading level."); } write(""); return this; diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/writers/MarkdownWriter.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/writers/MarkdownWriter.java index 95a53eecd6d..df07e8d6ce3 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/writers/MarkdownWriter.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/writers/MarkdownWriter.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.writers; import static software.amazon.smithy.docgen.DocgenUtils.getSymbolLink; @@ -92,14 +91,12 @@ private Pair> getReferencePair(Object value) { } else { throw new CodegenException( "Invalid type provided to $R. Expected both key and vale of the Pair to be Strings, but " - + "found " + value.getClass() - ); + + "found " + value.getClass()); } } else { throw new CodegenException( "Invalid type provided to $R. Expected a Symbol, SymbolReference, or Pair, but " - + "found " + value.getClass() - ); + + "found " + value.getClass()); } return Pair.of(text, ref); } diff --git a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/writers/SphinxMarkdownWriter.java b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/writers/SphinxMarkdownWriter.java index 671f5a4d64d..c2888ba4c22 100644 --- a/smithy-docgen/src/main/java/software/amazon/smithy/docgen/writers/SphinxMarkdownWriter.java +++ b/smithy-docgen/src/main/java/software/amazon/smithy/docgen/writers/SphinxMarkdownWriter.java @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen.writers; import java.util.Locale; diff --git a/smithy-docgen/src/test/java/software/amazon/smithy/docgen/SmithyDocPluginTest.java b/smithy-docgen/src/test/java/software/amazon/smithy/docgen/SmithyDocPluginTest.java index 5329cc3d156..526102055dc 100644 --- a/smithy-docgen/src/test/java/software/amazon/smithy/docgen/SmithyDocPluginTest.java +++ b/smithy-docgen/src/test/java/software/amazon/smithy/docgen/SmithyDocPluginTest.java @@ -2,24 +2,22 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ - package software.amazon.smithy.docgen; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.file.Paths; import org.junit.jupiter.api.Test; +import software.amazon.smithy.build.MockManifest; import software.amazon.smithy.build.PluginContext; import software.amazon.smithy.build.SmithyBuildPlugin; -import software.amazon.smithy.build.MockManifest; import software.amazon.smithy.model.Model; import software.amazon.smithy.model.node.Node; import software.amazon.smithy.utils.IoUtils; -import java.net.URI; -import java.net.URISyntaxException; -import java.nio.file.Paths; - public class SmithyDocPluginTest { @Test @@ -62,6 +60,6 @@ private String readExpectedPageContent(String filename) { } return IoUtils.readUtf8File(Paths.get(uri)) - .replace("\r\n", "\n"); + .replace("\r\n", "\n"); } }