Skip to content

Commit bec9420

Browse files
authored
Merge branch 'master' into drop-deprecated-method
2 parents fd5312c + cc4f13d commit bec9420

Some content is hidden

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

62 files changed

+28467
-12073
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: 0 additions & 17 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
@@ -90,8 +75,6 @@ jobs:
9075
bundler-cache: none
9176
- name: Set working directory as safe
9277
run: git config --global --add safe.directory $(pwd)
93-
- name: Set up permission
94-
run: chmod -R o-w /opt/hostedtoolcache/Ruby
9578
- name: Install dependencies
9679
run: |
9780
sudo apt-get update

.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

.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+
}

.vscode/settings.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"clangd.onConfigChanged": "restart",
3+
"[c]": {
4+
"editor.formatOnSave": true,
5+
"editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd"
6+
},
7+
"[cpp]": {
8+
"editor.formatOnSave": true,
9+
"editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd"
10+
},
11+
"[h]": {
12+
"editor.formatOnSave": true,
13+
"editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd"
14+
},
15+
"[hpp]": {
16+
"editor.formatOnSave": true,
17+
"editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd"
18+
}
19+
}

0 commit comments

Comments
 (0)