Skip to content

Commit 34cbd08

Browse files
committed
linting and formatting
1 parent 189ed43 commit 34cbd08

Some content is hidden

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

98 files changed

+6887
-6958
lines changed

.github/dependabot.yml

Lines changed: 47 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,47 @@
1-
# SPDX-FileCopyrightText: 2025 Knitli Inc. <knitli@knit.li>
2-
# SPDX-FileContributor: Adam Poulemanos <adam@knit.li>
3-
#
4-
# SPDX-License-Identifier: MIT OR Apache-2.0
5-
6-
version: 2
7-
updates:
8-
- package-ecosystem: cargo
9-
dependency-type: all
10-
update-types:
11-
- version-update:semver-minor
12-
- version-update:semver-patch
13-
versioning-strategy: increase
14-
directory: "/"
15-
schedule:
16-
interval: daily
17-
time: "23:00"
18-
open-pull-requests-limit: 10
19-
commit-message:
20-
prefix: "deps"
21-
assignees:
22-
- codegen-sh[bot]
23-
reviewers:
24-
- codegen-sh[bot]
25-
labels:
26-
- "dependencies"
27-
rebase-strategy: auto
28-
29-
- package-ecosystem: github-actions
30-
dependency-type: all
31-
update-types:
32-
- version-update:semver-major
33-
- version-update:semver-minor
34-
- version-update:semver-patch
35-
versioning-strategy: increase
36-
directory: "/.github/workflows"
37-
schedule:
38-
interval: daily
39-
time: "23:00"
40-
open-pull-requests-limit: 10
41-
commit-message:
42-
prefix: "deps"
43-
assignees:
44-
- codegen-sh[bot]
45-
reviewers:
46-
- codegen-sh[bot]
47-
labels:
48-
- "dependencies"
49-
rebase-strategy: auto
1+
# SPDX-FileCopyrightText: 2025 Knitli Inc. <knitli@knit.li>
2+
# SPDX-FileContributor: Adam Poulemanos <adam@knit.li>
3+
#
4+
# SPDX-License-Identifier: MIT OR Apache-2.0
5+
version: 2
6+
updates:
7+
- package-ecosystem: cargo
8+
dependency-type: all
9+
update-types:
10+
- version-update:semver-minor
11+
- version-update:semver-patch
12+
versioning-strategy: increase
13+
directory: "/"
14+
schedule:
15+
interval: daily
16+
time: "23:00"
17+
open-pull-requests-limit: 10
18+
commit-message:
19+
prefix: "deps"
20+
assignees:
21+
- codegen-sh[bot]
22+
reviewers:
23+
- codegen-sh[bot]
24+
labels:
25+
- "dependencies"
26+
rebase-strategy: auto
27+
- package-ecosystem: github-actions
28+
dependency-type: all
29+
update-types:
30+
- version-update:semver-major
31+
- version-update:semver-minor
32+
- version-update:semver-patch
33+
versioning-strategy: increase
34+
directory: "/.github/workflows"
35+
schedule:
36+
interval: daily
37+
time: "23:00"
38+
open-pull-requests-limit: 10
39+
commit-message:
40+
prefix: "deps"
41+
assignees:
42+
- codegen-sh[bot]
43+
reviewers:
44+
- codegen-sh[bot]
45+
labels:
46+
- "dependencies"
47+
rebase-strategy: auto

.github/workflows/ci.yml

Lines changed: 77 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -2,98 +2,84 @@
22
# SPDX-FileContributor: Adam Poulemanos <adam@knit.li>
33
#
44
# SPDX-License-Identifier: MIT OR Apache-2.0
5-
65
name: CI
7-
86
on:
9-
push:
10-
branches: [main, develop]
11-
pull_request:
12-
branches: [main, develop]
13-
7+
push:
8+
branches: [main, develop]
9+
pull_request:
10+
branches: [main, develop]
1411
env:
15-
CARGO_TERM_COLOR: always
16-
12+
CARGO_TERM_COLOR: always
1713
jobs:
18-
test:
19-
name: Test Suite
20-
runs-on: ubuntu-latest
21-
strategy:
22-
matrix:
23-
rust:
24-
- stable
25-
- beta
26-
- nightly
27-
steps:
28-
- uses: actions/checkout@v4
29-
with:
30-
submodules: recursive
31-
32-
- name: Install Rust
33-
uses: dtolnay/rust-toolchain@master
34-
with:
35-
toolchain: ${{ matrix.rust }}
36-
components: rustfmt, clippy
37-
38-
- name: Cache cargo registry
39-
uses: actions/cache@v4
40-
with:
41-
path: ~/.cargo/registry
42-
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
43-
44-
- name: Cache cargo index
45-
uses: actions/cache@v4
46-
with:
47-
path: ~/.cargo/git
48-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
49-
50-
- name: Cache cargo build
51-
uses: actions/cache@v4
52-
with:
53-
path: target
54-
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
55-
56-
- name: Set up mise
57-
run: |
58-
chmod -R +x ./scripts
59-
./install-mise.sh
60-
MISE="$HOME/.local/bin/mise"
61-
echo 'eval "$($MISE activate bash)"' >> "$HOME/.bashrc"
62-
source "$HOME/.bashrc"
63-
$MISE run install
64-
- name: Run hk ci workflow
65-
run: $HOME/.local/bin/mise run ci
66-
67-
security_audit:
68-
name: Security Audit
69-
runs-on: ubuntu-latest
70-
steps:
71-
- uses: actions/checkout@v4
72-
- uses: rustsec/audit-check@v1.4.1
73-
with:
74-
token: ${{ secrets.GITHUB_TOKEN }}
75-
76-
coverage:
77-
name: Code Coverage
78-
runs-on: ubuntu-latest
79-
steps:
80-
- uses: actions/checkout@v4
81-
with:
82-
submodules: recursive
83-
84-
- name: Install Rust
85-
uses: dtolnay/rust-toolchain@stable
86-
with:
87-
components: llvm-tools-preview
88-
89-
- name: Install cargo-llvm-cov
90-
uses: taiki-e/install-action@cargo-llvm-cov
91-
92-
- name: Generate code coverage
93-
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
94-
95-
- name: Upload coverage to Codecov
96-
uses: codecov/codecov-action@v4
97-
with:
98-
files: lcov.info
99-
fail_ci_if_error: true
14+
test:
15+
name: Test Suite
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
rust:
20+
- stable
21+
- beta
22+
- nightly
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
submodules: recursive
27+
- name: Install Rust
28+
uses: dtolnay/rust-toolchain@master
29+
with:
30+
toolchain: ${{ matrix.rust }}
31+
components: rustfmt, clippy
32+
- name: Cache cargo registry
33+
uses: actions/cache@v4
34+
with:
35+
path: ~/.cargo/registry
36+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
37+
- name: Cache cargo index
38+
uses: actions/cache@v4
39+
with:
40+
path: ~/.cargo/git
41+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
42+
- name: Cache cargo build
43+
uses: actions/cache@v4
44+
with:
45+
path: target
46+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
47+
- name: Set up mise
48+
run: |
49+
chmod -R +x ./scripts
50+
./install-mise.sh
51+
MISE="$HOME/.local/bin/mise"
52+
echo \"eval "$($MISE activate bash)"\" >> "$HOME/.bashrc"
53+
source "$HOME/.bashrc"
54+
$MISE run install
55+
- name: Run hk ci workflow
56+
run: >
57+
"$HOME/.local/bin/mise" run ci
58+
security_audit:
59+
name: Security Audit
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v4
63+
- uses: rustsec/audit-check@v1.4.1
64+
with:
65+
token: ${{ secrets.GITHUB_TOKEN }}
66+
coverage:
67+
name: Code Coverage
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v4
71+
with:
72+
submodules: recursive
73+
- name: Install Rust
74+
uses: dtolnay/rust-toolchain@stable
75+
with:
76+
components: llvm-tools-preview
77+
- name: Install cargo-llvm-cov
78+
uses: taiki-e/install-action@cargo-llvm-cov
79+
- name: Generate code coverage
80+
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
81+
- name: Upload coverage to Codecov
82+
uses: codecov/codecov-action@v4
83+
with:
84+
files: lcov.info
85+
fail_ci_if_error: true

.github/workflows/cla.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,25 @@
22
# SPDX-FileContributor: Adam Poulemanos <adam@knit.li>
33
#
44
# SPDX-License-Identifier: MIT OR Apache-2.0
5-
65
name: "CLA Assistant"
76
on:
87
issue_comment:
98
types: [created]
109
pull_request_target:
11-
types: [opened,closed,synchronize]
12-
10+
types: [opened, closed, synchronize]
1311
permissions:
1412
actions: write
1513
contents: write # this can be 'read' if the signatures are in remote repository
1614
pull-requests: write
1715
statuses: write
18-
1916
jobs:
2017
CLAAssistant:
2118
runs-on: ubuntu-latest
2219
steps:
2320
- name: "CLA Assistant"
2421
if: >
2522
(github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the contributors license agreement and I agree to it.') || github.event_name == 'pull_request_target'
23+
2624
uses: contributor-assistant/github-action@v2.6.1
2725
env:
2826
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -35,8 +33,7 @@ jobs:
3533
# branch should not be protected
3634
branch: 'main'
3735
allowlist: bashandbone,codegen-sh[bot],dependabot[bot],github-actions[bot],actions-user,changeset-bot
38-
39-
# the followings are the optional inputs - If the optional inputs are not given, then default values will be taken
36+
# the followings are the optional inputs - If the optional inputs are not given, then default values will be taken
4037
#remote-organization-name: enter the remote organization name where the signatures should be stored (Default is storing the signatures in the same repository)
4138
#remote-repository-name: enter the remote repository name where the signatures should be stored (Default is storing the signatures in the same repository)
4239
create-file-commit-message: 'Adding file for tracking CLA signatures'

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ inherits = "dev"
9595
codegen-backend = "cranelift"
9696

9797
[profile.release]
98-
lto = true # Link-time optimization
98+
lto = true # Link-time optimization
9999
codegen-units = 1
100100
incremental = false
101-
panic = "abort" # Smaller binary size
102-
opt-level = 3 # Maximum optimization
101+
panic = "abort" # Smaller binary size
102+
opt-level = 3 # Maximum optimization
103103

104104
[profile.release-dev]
105105
inherits = "release"

_typos.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
locale = "en-us"
77
check-file = true
88
check-filename = true
9-
extend-ignore-re = ["(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on"]
9+
extend-ignore-re = [
10+
"(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on",
11+
]
1012
extend-ignore-identifiers-re = [
1113
"iif",
1214
"iife",

crates/ast-engine/Cargo.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ name = "thread-ast-engine"
77
description = "Core AST engine for Thread - parsing, matching, and transforming code using AST patterns. Forked from ast-grep-core."
88
keywords = ["ast", "pattern", "codemod", "search", "rewrite"]
99
categories = ["command-line-utilities", "development-tools", "parsing"]
10+
readme = "README.md"
1011
license = "AGPL-3.0-or-later AND MIT"
1112
version = "0.1.0"
1213
authors = [
@@ -22,7 +23,10 @@ rust-version.workspace = true
2223
include.workspace = true
2324

2425
[dependencies]
25-
thread-utils = { workspace = true, default-features = false, features = ["hashers", "simd"] }
26+
thread-utils = { workspace = true, default-features = false, features = [
27+
"hashers",
28+
"simd",
29+
] }
2630
thiserror.workspace = true
2731

2832
# Tree-sitter required for parsing
@@ -40,15 +44,15 @@ matching = ["dep:regex", "dep:bit-set"]
4044

4145
[dev-dependencies]
4246
tree-sitter-typescript = "0.23.2"
43-
thread-language = { workspace = true, features = ["builtin-parser"]}
47+
thread-language = { workspace = true, features = ["builtin-parser"] }
4448
criterion = { version = "0.6.0", features = ["html_reports"] }
4549

4650
[[bench]]
4751
name = "performance_improvements"
4852
harness = false
4953

5054
[build-dependencies]
51-
cc = "*"
55+
cc = "1.2.30"
5256

5357
[lints]
5458
# Enable linting for the crate

crates/ast-engine/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2025 Knitli Inc. <knitli@knit.li>
3+
SPDX-FileContributor: Adam Poulemanos <adam@knit.li>
4+
5+
SPDX-License-Identifier: MIT OR Apache-2.0
6+
-->

0 commit comments

Comments
 (0)