Skip to content

Commit ae509ee

Browse files
authored
Merge branch 'master' into subtractor-civar
2 parents 7b67f2a + 1cdd763 commit ae509ee

File tree

204 files changed

+40687
-10010
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+40687
-10010
lines changed

.clang-format

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
Language: Cpp
3+
4+
# Indentation
5+
UseTab: Never
6+
IndentWidth: 4
7+
BreakBeforeBraces: Attach
8+
IndentCaseLabels: false
9+
NamespaceIndentation: None
10+
ContinuationIndentWidth: 4
11+
IndentPPDirectives: None
12+
IndentWrappedFunctionNames: false
13+
AccessModifierOffset: -2
14+
15+
# Alignment
16+
AlignAfterOpenBracket: BlockIndent
17+
AlignConsecutiveAssignments: false
18+
AlignConsecutiveDeclarations: false
19+
AlignConsecutiveMacros: false
20+
AlignEscapedNewlines: Left
21+
AlignOperands: false
22+
AlignTrailingComments: true
23+
DerivePointerAlignment: false
24+
PointerAlignment: Right
25+
26+
# Function calls formatting
27+
BinPackArguments: false
28+
BinPackParameters: false
29+
AllowAllArgumentsOnNextLine: false
30+
ExperimentalAutoDetectBinPacking: false
31+
PenaltyBreakBeforeFirstCallParameter: 1
32+
AlwaysBreakAfterDefinitionReturnType: None
33+
34+
# Wrapping and Breaking
35+
ColumnLimit: 0
36+
AllowShortBlocksOnASingleLine: Never
37+
AllowShortCaseLabelsOnASingleLine: false
38+
AllowShortFunctionsOnASingleLine: All
39+
AllowShortIfStatementsOnASingleLine: Always
40+
AllowShortLoopsOnASingleLine: false
41+
AlwaysBreakAfterReturnType: None
42+
AlwaysBreakBeforeMultilineStrings: false
43+
AlwaysBreakTemplateDeclarations: No
44+
BreakBeforeBinaryOperators: None
45+
BreakBeforeTernaryOperators: false
46+
BreakConstructorInitializers: BeforeColon
47+
BreakInheritanceList: BeforeColon
48+
BreakStringLiterals: false
49+
CompactNamespaces: false
50+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
51+
Cpp11BracedListStyle: false
52+
ReflowComments: false
53+
SortIncludes: Never
54+
55+
# Spaces
56+
SpaceAfterCStyleCast: true
57+
SpaceAfterLogicalNot: false
58+
SpaceAfterTemplateKeyword: true
59+
SpaceBeforeAssignmentOperators: true
60+
SpaceBeforeCpp11BracedList: true
61+
SpaceBeforeCtorInitializerColon: true
62+
SpaceBeforeInheritanceColon: true
63+
SpaceBeforeParens: ControlStatements
64+
SpaceBeforeRangeBasedForLoopColon: true
65+
SpaceBeforeSquareBrackets: false
66+
SpaceInEmptyBlock: false
67+
SpaceInEmptyParentheses: false
68+
SpacesBeforeTrailingComments: 1
69+
SpacesInAngles: false
70+
SpacesInCStyleCastParentheses: false
71+
SpacesInConditionalStatement: false
72+
SpacesInContainerLiterals: true
73+
SpacesInParentheses: false
74+
SpacesInSquareBrackets: false

.clangd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CompileFlags:
2+
CompilationDatabase: ext/rbs_extension

.github/workflows/c-check.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: C Code Generation and Formatting Check
2+
3+
on:
4+
push:
5+
pull_request: {}
6+
merge_group: {}
7+
8+
jobs:
9+
format-check:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: ruby/setup-ruby@v1
14+
with:
15+
ruby-version: "3.4"
16+
bundler-cache: none
17+
- name: Set working directory as safe
18+
run: git config --global --add safe.directory $(pwd)
19+
- name: Install dependencies
20+
run: |
21+
sudo apt-get update
22+
sudo apt-get install -y libdb-dev curl autoconf automake m4 libtool
23+
- name: Install clang-format from LLVM
24+
run: |
25+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
26+
sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main"
27+
sudo apt-get update
28+
sudo apt-get install -y clang-format
29+
clang-format --version
30+
- name: Install Re2c
31+
run: |
32+
cd /tmp
33+
curl -L https://github.com/skvadrik/re2c/archive/refs/tags/3.1.tar.gz > re2c-3.1.tar.gz
34+
tar xf re2c-3.1.tar.gz
35+
cd re2c-3.1
36+
autoreconf -i -W all
37+
./configure
38+
make
39+
sudo make install
40+
- name: Update rubygems & bundler
41+
run: |
42+
ruby -v
43+
gem update --system
44+
- name: bin/setup
45+
run: |
46+
bin/setup
47+
- name: Check C code generation and formatting
48+
run: |
49+
clang-format --version
50+
bundle exec rake lexer templates compile confirm_lexer confirm_templates
51+
bundle exec rake format:c_check

.github/workflows/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
1515
steps:
1616
- name: Dependabot metadata
17-
uses: dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7 # v2.3.0
17+
uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b # v2.4.0
1818
id: metadata
1919
- name: Checkout repository
2020
uses: actions/checkout@v4

.github/workflows/ruby.yml

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ jobs:
2828
- ruby: "3.4"
2929
job: stdlib_test
3030
rubyopt: "--enable-frozen-string-literal"
31-
- ruby: "3.4"
32-
job: lexer templates compile confirm_lexer confirm_templates
3331
- ruby: "3.4"
3432
job: rubocop validate test_doc build test_generate_stdlib raap
3533
- ruby: "3.4"
@@ -44,23 +42,10 @@ jobs:
4442
bundler: none
4543
- name: Set working directory as safe
4644
run: git config --global --add safe.directory $(pwd)
47-
- name: Set up permission
48-
run: chmod -R o-w /opt/hostedtoolcache/Ruby
4945
- name: Install dependencies
5046
run: |
5147
sudo apt-get update
5248
sudo apt-get install -y libdb-dev curl autoconf automake m4 libtool python3
53-
- name: Install Re2c
54-
if: ${{ contains(matrix.job, 'lexer') }}
55-
run: |
56-
cd /tmp
57-
curl -L https://github.com/skvadrik/re2c/archive/refs/tags/3.1.tar.gz > re2c-3.1.tar.gz
58-
tar xf re2c-3.1.tar.gz
59-
cd re2c-3.1
60-
autoreconf -i -W all
61-
./configure
62-
make
63-
sudo make install
6449
- name: Update rubygems & bundler
6550
run: |
6651
ruby -v
@@ -80,29 +65,35 @@ jobs:
8065
- name: Run test
8166
run: |
8267
bundle exec rake ${{ matrix.job }}
83-
valgrind:
84-
runs-on: ubuntu-latest
68+
C99_compile:
69+
runs-on: macos-latest
70+
strategy:
71+
fail-fast: false
72+
matrix:
73+
ruby: ['3.4', head]
8574
steps:
8675
- uses: actions/checkout@v4
76+
- name: Install dependencies
77+
run: |
78+
brew install ruby-build
8779
- uses: ruby/setup-ruby@v1
8880
with:
89-
ruby-version: "3.4"
90-
bundler-cache: none
81+
ruby-version: ${{ matrix.ruby }}
82+
bundler: none
9183
- name: Set working directory as safe
9284
run: git config --global --add safe.directory $(pwd)
93-
- name: Set up permission
94-
run: chmod -R o-w /opt/hostedtoolcache/Ruby
95-
- name: Install dependencies
96-
run: |
97-
sudo apt-get update
98-
sudo apt-get install -y libdb-dev curl autoconf automake m4 libtool python3 valgrind
9985
- name: Update rubygems & bundler
10086
run: |
10187
ruby -v
10288
gem update --system
89+
- name: clang version
90+
run: clang --version
91+
- name: bundle config set force_ruby_platform true if head
92+
if: ${{ contains(matrix.ruby, 'head') }}
93+
run: |
94+
bundle config set force_ruby_platform true
10395
- name: bin/setup
10496
run: |
10597
bin/setup
106-
- run: bundle exec rake test:valgrind
107-
env:
108-
RUBY_FREE_AT_EXIT: 1
98+
- run: bundle exec rake clean compile_c99
99+

.github/workflows/typecheck.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ jobs:
2020
bundler: none
2121
- name: Set working directory as safe
2222
run: git config --global --add safe.directory $(pwd)
23-
- name: Set up permission
24-
run: chmod -R o-w /opt/hostedtoolcache/Ruby
2523
- name: Install dependencies
2624
run: |
2725
sudo apt-get update

.github/workflows/valgrind.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Valgrind
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- "ext/**"
9+
- "include/**"
10+
- "src/**"
11+
pull_request:
12+
paths:
13+
- "ext/**"
14+
- "include/**"
15+
- "src/**"
16+
merge_group: {}
17+
18+
jobs:
19+
valgrind:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: ruby/setup-ruby@v1
24+
with:
25+
ruby-version: "3.4"
26+
bundler-cache: none
27+
- name: Set working directory as safe
28+
run: git config --global --add safe.directory $(pwd)
29+
- name: Install dependencies
30+
run: |
31+
sudo apt-get update
32+
sudo apt-get install -y libdb-dev curl autoconf automake m4 libtool python3 valgrind
33+
- name: Update rubygems & bundler
34+
run: |
35+
ruby -v
36+
gem update --system
37+
- name: bin/setup
38+
run: |
39+
bin/setup
40+
- run: bundle exec rake test:valgrind
41+
env:
42+
RUBY_FREE_AT_EXIT: 1

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@ lib/**/*.dll
2121
doc/
2222

2323
**/*.gem
24+
25+
# For clangd's editor integration
26+
ext/rbs_extension/compile_commands.json
27+
ext/rbs_extension/.cache

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require:
1+
plugins:
22
- rubocop-rubycw
33
- rubocop-on-rbs
44

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"llvm-vs-code-extensions.vscode-clangd"
4+
]
5+
}

0 commit comments

Comments
 (0)