Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Snippets/Parsing/test.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Sample document

This is a *sample document*.

<!-- Copyright (c) 2022 Apple Inc and the Swift Project authors. All Rights Reserved. -->
2 changes: 2 additions & 0 deletions Sources/Markdown/Markdown.docc/Snippets.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ a Markdown document to a consistent, preferred style.
@Snippet(path: "swift-markdown/Snippets/Formatting/PreferredHeadingStyle")
@Snippet(path: "swift-markdown/Snippets/Formatting/ThematicBreakCharacter")
@Snippet(path: "swift-markdown/Snippets/Formatting/UseCodeFence")

<!-- Copyright (c) 2022 Apple Inc and the Swift Project authors. All Rights Reserved. -->
23 changes: 20 additions & 3 deletions bin/check-source
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

function replace_acceptable_years() {
# this needs to replace all acceptable forms with 'YEARS'
sed -e 's/20[12][78901]-20[12][89012]/YEARS/' -e 's/20[12][89012]/YEARS/'
sed -e 's/20[12][7890123]-20[12][890123]/YEARS/' -e 's/20[12][890123]/YEARS/'
}

printf "=> Checking for unacceptable language… "
Expand All @@ -40,7 +40,7 @@ printf "\033[0;32mokay.\033[0m\n"
printf "=> Checking license headers… "
tmp=$(mktemp /tmp/.swift-markdown-check-source_XXXXXX)

for language in swift-or-c bash md-or-tutorial html docker; do
for language in swift-or-c snippet bash md-or-tutorial html docker; do
declare -a matching_files
declare -a exceptions
declare -a reader
Expand All @@ -49,7 +49,7 @@ for language in swift-or-c bash md-or-tutorial html docker; do
reader=head
case "$language" in
swift-or-c)
exceptions=( -name 'Package*.swift')
exceptions=( -name 'Package*.swift' -o -path './Snippets/*')
matching_files=( -name '*.swift' -o -name '*.c' -o -name '*.h' )
cat > "$tmp" <<"EOF"
/*
Expand All @@ -61,6 +61,22 @@ for language in swift-or-c bash md-or-tutorial html docker; do
See https://swift.org/LICENSE.txt for license information
See https://swift.org/CONTRIBUTORS.txt for Swift project authors
*/
EOF
;;
snippet)
matching_files=( -name '*.swift' -a -path './Snippets/*')
exceptions=( -name 'Package*.swift')
reader=tail
cat > "$tmp" <<"EOF"
/*
This source file is part of the Swift.org open source project

Copyright (c) YEARS Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
See https://swift.org/CONTRIBUTORS.txt for Swift project authors
*/
EOF
;;
bash)
Expand Down Expand Up @@ -150,3 +166,4 @@ done
printf "\033[0;32mokay.\033[0m\n"
rm "$tmp"

# vim: filetype=bash shiftwidth=2 softtabstop=2