From 8fc79cae9d03a5e623c52cc2dbd2df165a7832b0 Mon Sep 17 00:00:00 2001 From: Joseph Heck Date: Tue, 19 Jul 2022 22:38:17 -0700 Subject: [PATCH] minimal DocC markdown to order Logger.Levels (#225) * minimal DocC markdown to order Logger.Levels Motivation: When viewed in documentation generated by DocC, the enumeration levels are ordered alphabetically, removintg the implied ordering in the source. The written overview of the enum relies on that ordering to make sense. Modifications: Adding a single file that provides structure to Logging/Logger/Levels within DocC generated documentation. Result: When imported into a project that leverages Swift 5.6 (such as Vapor), the generated documentation for the levels provided by Logging/Logger/Levels are displayed in the order intended/expected by the documentation. * Adding a Swift 5.6 version of Package.swift Motivation: Per DocC team, an updated version is required for the DocC changes to be picked up and reflected in generated dcumentation, even for upstream projects already using swift 5.6 or later. Modifications: Adding Package.Swift@5.6 with the swift version updated. Result: Hopefully, documentation updates in DocC generated content will be reflected. * Updating linuxmain test generation for --- Package@swift-5.6.swift | 33 ++++++++++++++++++++ Sources/Logging/Documentation.docc/Logger.md | 13 ++++++++ docker/docker-compose.2004.56.yaml | 3 +- docker/docker-compose.2004.57.yaml | 3 +- docker/docker-compose.2004.main.yaml | 3 +- docker/docker-compose.yaml | 2 +- scripts/soundness.sh | 2 +- 7 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 Package@swift-5.6.swift create mode 100644 Sources/Logging/Documentation.docc/Logger.md diff --git a/Package@swift-5.6.swift b/Package@swift-5.6.swift new file mode 100644 index 0000000..f8dccfb --- /dev/null +++ b/Package@swift-5.6.swift @@ -0,0 +1,33 @@ +// swift-tools-version:5.6 +//===----------------------------------------------------------------------===// +// +// This source file is part of the Swift Logging API open source project +// +// Copyright (c) 2018-2019 Apple Inc. and the Swift Logging API project authors +// Licensed under Apache License v2.0 +// +// See LICENSE.txt for license information +// See CONTRIBUTORS.txt for the list of Swift Logging API project authors +// +// SPDX-License-Identifier: Apache-2.0 +// +//===----------------------------------------------------------------------===// + +import PackageDescription + +let package = Package( + name: "swift-log", + products: [ + .library(name: "Logging", targets: ["Logging"]), + ], + targets: [ + .target( + name: "Logging", + dependencies: [] + ), + .testTarget( + name: "LoggingTests", + dependencies: ["Logging"] + ), + ] +) diff --git a/Sources/Logging/Documentation.docc/Logger.md b/Sources/Logging/Documentation.docc/Logger.md new file mode 100644 index 0000000..c9ceda4 --- /dev/null +++ b/Sources/Logging/Documentation.docc/Logger.md @@ -0,0 +1,13 @@ +# ``Logging/Logger/Level`` + +## Topics + +### Log levels + +- ``trace`` +- ``debug`` +- ``info`` +- ``notice`` +- ``warning`` +- ``error`` +- ``critical`` diff --git a/docker/docker-compose.2004.56.yaml b/docker/docker-compose.2004.56.yaml index 76366ee..9b025bb 100644 --- a/docker/docker-compose.2004.56.yaml +++ b/docker/docker-compose.2004.56.yaml @@ -11,7 +11,8 @@ services: test: image: swift-log:20.04-5.6 - environment: [] + environment: + - FORCE_TEST_DISCOVERY=--enable-test-discovery #- SANITIZER_ARG=--sanitize=thread shell: diff --git a/docker/docker-compose.2004.57.yaml b/docker/docker-compose.2004.57.yaml index 13a8d05..94c5b5a 100644 --- a/docker/docker-compose.2004.57.yaml +++ b/docker/docker-compose.2004.57.yaml @@ -10,7 +10,8 @@ services: test: image: swift-log:20.04-5.7 - environment: [] + environment: + - FORCE_TEST_DISCOVERY=--enable-test-discovery #- SANITIZER_ARG=--sanitize=thread shell: diff --git a/docker/docker-compose.2004.main.yaml b/docker/docker-compose.2004.main.yaml index 377cd27..e73688e 100644 --- a/docker/docker-compose.2004.main.yaml +++ b/docker/docker-compose.2004.main.yaml @@ -10,7 +10,8 @@ services: test: image: swift-log:20.04-main - environment: [] + environment: + - FORCE_TEST_DISCOVERY=--enable-test-discovery #- SANITIZER_ARG=--sanitize=thread shell: diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 69ab5c7..3d52128 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -28,7 +28,7 @@ services: test: <<: *common - command: /bin/bash -xcl "swift test -Xswiftc -warnings-as-errors $${SANITIZER_ARG-}" + command: /bin/bash -xcl "swift test -Xswiftc -warnings-as-errors $${FORCE_TEST_DISCOVERY-} $${SANITIZER_ARG-}" # util diff --git a/scripts/soundness.sh b/scripts/soundness.sh index f2a00dc..acde75e 100755 --- a/scripts/soundness.sh +++ b/scripts/soundness.sh @@ -86,7 +86,7 @@ for language in swift-or-c bash dtrace; do matching_files=( -name '*' ) case "$language" in swift-or-c) - exceptions=( -name c_nio_http_parser.c -o -name c_nio_http_parser.h -o -name cpp_magic.h -o -name Package.swift -o -name CNIOSHA1.h -o -name c_nio_sha1.c -o -name ifaddrs-android.c -o -name ifaddrs-android.h) + exceptions=( -name c_nio_http_parser.c -o -name c_nio_http_parser.h -o -name cpp_magic.h -o -name Package.swift -o name Package-swift5.6.swift -o -name CNIOSHA1.h -o -name c_nio_sha1.c -o -name ifaddrs-android.c -o -name ifaddrs-android.h) matching_files=( -name '*.swift' -o -name '*.c' -o -name '*.h' ) cat > "$tmp" <<"EOF" //===----------------------------------------------------------------------===//