Skip to content

Commit 25c3951

Browse files
committed
some cleanup from release trials
1 parent 3e9c128 commit 25c3951

File tree

8 files changed

+59
-24
lines changed

8 files changed

+59
-24
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ updates:
1414
patterns:
1515
- "*"
1616
- package-ecosystem: pip
17-
directory: cpp-linter-py/
17+
directory: py-binding/
1818
schedule:
1919
interval: "weekly"
2020
groups:
@@ -26,7 +26,7 @@ updates:
2626
schedule:
2727
interval: "weekly"
2828
ignore:
29-
- dependency-name: cpp-linter-lib
29+
- dependency-name: cpp-linter
3030
groups:
3131
cargo:
3232
patterns:

.github/workflows/binary-builds.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,6 @@ jobs:
136136
persist-credentials: false
137137
- name: Install Rust
138138
run: rustup update stable --no-self-update
139-
- uses: actions/setup-python@v5
140-
with:
141-
python-version: '3.x'
142-
- run: cargo package -p cpp-linter
143139
- name: Download built assets
144140
uses: actions/download-artifact@v4
145141
with:

.github/workflows/build-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@ jobs:
7272
uses: actions/upload-artifact@v4
7373
with:
7474
path: target/doc
75-
name: cpp-linter-lib_docs
75+
name: cpp-linter-api_docs

.github/workflows/bump_version.py

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,39 @@
33
import sys
44
import re
55

6-
VER_PATTERN = re.compile(r'^version = "(\d+)\.(\d+)\.(\d+)[^"]*" # auto', re.MULTILINE)
7-
VER_REPLACE = 'version = "%d.%d.%d" # auto'
8-
COMPONENTS = ("major", "minor", "patch")
6+
VER_PATTERN = re.compile(
7+
r'^version = "(\d+)\.(\d+)\.(\d+)(?:\-rc)?(\d*)[^"]*" # auto', re.MULTILINE
8+
)
9+
VER_REPLACE = 'version = "%d.%d.%d%s" # auto'
10+
COMPONENTS = ("major", "minor", "patch", "rc")
911

1012

1113
class Updater:
1214
component: str = "patch"
1315

1416
@staticmethod
1517
def replace(match: re.Match[str]) -> str:
16-
ver = [int(x) for x in match.groups()[: len(COMPONENTS)]]
17-
for _ in range(len(ver) - 1, len(COMPONENTS)):
18-
ver.append(0)
19-
print("old version:", ".".join([str(x) for x in ver]))
18+
ver = []
19+
for v in match.groups():
20+
try:
21+
ver.append(int(v))
22+
except ValueError:
23+
ver.append(0)
24+
old_version = ".".join([str(x) for x in ver[:3]])
25+
rc_str = ""
26+
if ver[3] > 0:
27+
rc_str = f"-rc{ver[3]}"
28+
old_version += rc_str
29+
print("old version:", old_version)
2030
index = COMPONENTS.index(Updater.component)
2131
ver[index] += 1
22-
for i in range(index + 1, 3):
32+
for i in range(index + 1, len(COMPONENTS)):
2333
ver[i] = 0
24-
print("new version:", ".".join([str(x) for x in ver]))
25-
return VER_REPLACE % tuple(ver)
34+
new_version = ".".join([str(x) for x in ver[:3]])
35+
rc_str = f"-rc{ver[3]}" if ver[3] > 0 else ""
36+
new_version += rc_str
37+
print("new version:", new_version)
38+
return VER_REPLACE % (tuple(ver[:3]) + (rc_str,))
2639

2740

2841
def main():

.vscode/tasks.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"--bin",
1313
"cpp-linter",
1414
"--manifest-path",
15-
"cpp-linter-lib/Cargo.toml",
15+
"cpp-linter/Cargo.toml",
1616
"--",
1717
"${input:binArgs}"
1818
],
@@ -67,7 +67,7 @@
6767
"nextest",
6868
"--lib",
6969
"--manifest-path",
70-
"cpp-linter-lib/Cargo.toml"
70+
"cpp-linter/Cargo.toml"
7171
],
7272
"group": {
7373
"kind": "test",
@@ -154,7 +154,7 @@
154154
"--no-deps",
155155
"--lib",
156156
"--manifest-path",
157-
"cpp-linter-lib/Cargo.toml",
157+
"cpp-linter/Cargo.toml",
158158
"--open"
159159
],
160160
"group": "build"
@@ -215,7 +215,8 @@
215215
"options": [
216216
"major",
217217
"minor",
218-
"patch"
218+
"patch",
219+
"rc"
219220
]
220221
}
221222
]

cpp-linter/tests/common/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use tempfile::TempDir;
1616
///
1717
/// The meson build system generator and the ninja build system are
1818
/// third-party dependencies of these tests. They are used to generate
19-
/// a compilation database for clang-tidy (and cpp-linter-lib) to utilize.
19+
/// a compilation database for clang-tidy (and cpp-linter) to utilize.
2020
///
2121
/// The returned directory object will automatically delete the
2222
/// temporary folder when it is dropped out of scope.

docs/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! This is a preprocessor for mdbook that generates the CLI document.
2-
//! For actual library/binary source code look in cpp-linter-lib or cpp-linter-py folders
2+
//! For actual library/binary source code look in cpp-linter folder.
33
44
extern crate clap;
55
use clap::{Arg, ArgMatches, Command};

install-clang-action/README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,29 @@ This is action is not meant to be published in the GitHub marketplace.
44
It intended to be a repo-specific action for installing multiple versions of
55
clang-format and clang-tidy in a single workflow run.
66

7-
This is used in the cpp-linter-lib tests only.
7+
This is used in the cpp-linter rust tests only.
8+
9+
## Example
10+
11+
```yml
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Install clang tools v16
17+
uses: cpp-linter/cpp_linter_rs/install-clang-action@main
18+
with:
19+
version: 16
20+
- name: test with clang tools v16
21+
env:
22+
CLANG_VERSION: 16
23+
run: just test
24+
- name: Install clang tools v17
25+
uses: cpp-linter/cpp_linter_rs/install-clang-action@main
26+
with:
27+
version: 17
28+
- name: test with clang tools v17
29+
env:
30+
CLANG_VERSION: 17
31+
run: just test
32+
```

0 commit comments

Comments
 (0)