-
-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat/indirect-branch-tracking
- Loading branch information
Showing
16 changed files
with
76 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,37 @@ | ||
name: Validate content | ||
on: | ||
push: | ||
paths: | ||
- docs/syntax_and_semantics/compile_time_flags.md | ||
- .github/workflows/validate-content.yml | ||
pull_request: | ||
branches: [master, release/*] | ||
paths: | ||
- docs/syntax_and_semantics/compile_time_flags.md | ||
- .github/workflows/validate-content.yml | ||
schedule: | ||
- cron: '0 5 * * 1' # Every Monday 5 AM UTC | ||
|
||
jobs: | ||
validate-flags: | ||
name: Validate flags | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
- os: macos-latest | ||
- os: windows-latest | ||
runs-on: ${{ matrix.os }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download source | ||
uses: actions/checkout@v4 | ||
- name: Install Crystal | ||
uses: crystal-lang/install-crystal@v1 | ||
with: | ||
crystal: nightly | ||
- name: Download crystal repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: crystal-lang/crystal | ||
path: crystal | ||
# If the PR goes against a release branch, we checkout that same release | ||
# branch in the Crystal repo (names are identical). | ||
ref: ${{ (startsWith(github.base_ref, 'release/') && github.base_ref) || 'master' }} | ||
- name: Run test script | ||
run: scripts/validate-flags.sh | ||
env: | ||
STDLIB_SRC: ./crystal/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ end | |
def method2( | ||
@[MyAnnotation] | ||
bar | ||
bar, | ||
) | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ if @@a | |
end | ||
a = nil | ||
closure = ->{ a = "foo" } | ||
closure = -> { a = "foo" } | ||
if a | ||
# here `a` can be nil | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env crystal | ||
# | ||
# This script parses output from `mkdocs build --strict` to find ill-formatted | ||
# code blocks and applies the updated formatting (from the formatter STDOUT). | ||
|
||
io = STDIN | ||
docs_path = Path["docs"] | ||
|
||
loop do | ||
line = io.gets || exit | ||
line.starts_with?("WARNING - In file") || next | ||
filename = line[/(?<=')[^']+(?=')/]? || next | ||
filename = docs_path / filename | ||
|
||
io.gets # skip -------- Input -------- | ||
|
||
input = IO::Delimited.new(io, "\n-------- Output --------\n").gets_to_end | ||
output = IO::Delimited.new(io, "formatting 'STDIN' produced changes\n").gets_to_end | ||
|
||
original_content = File.read(filename) | ||
content = original_content.sub input, output | ||
File.write(filename, content) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters