Skip to content

Commit a0b7788

Browse files
committed
wip: init commit - reports just the files that changed
1 parent 8d26d4b commit a0b7788

File tree

15 files changed

+6172
-3
lines changed

15 files changed

+6172
-3
lines changed

.github/actions/clippy-annotation-reporter/Cargo.lock

Lines changed: 2935 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[package]
2+
name = "clippy-annotation-reporter"
3+
rust-version = "1.78.0"
4+
edition = "2021"
5+
version = "0.1.0"
6+
7+
[dependencies]
8+
clap = { version = "4.3", features = ["derive", "env"] }
9+
octocrab = "0.44"
10+
anyhow = "1.0"
11+
regex = "1.9"
12+
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
13+
serde_json = "1.0"
14+
log = "0.4"
15+
env_logger = "0.10"
16+
# Octocrab has a defined MSRV < 1.78 and depends on url 2.5.4 which also has a defined MSRV < 1.78 but url has a dependency on `idna` has a MSRV of 1.81. Not sure what is going on here.
17+
url = "=2.5.2"
18+
toml = "0.8.22"
19+
mockall = "0.13.1"
20+
21+
[dev-dependencies]
22+
httpmock = "0.6"
23+
http = "1.1.0"
24+
tempfile = "3.20.0"
25+
26+
# TODO: Remove this when move to separate repo
27+
[workspace]
28+
members = ["."]
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: 'Clippy Annotation Reporter'
2+
description: 'Reports changes in Clippy allow annotations'
3+
author: 'Datadog'
4+
5+
inputs:
6+
github-token:
7+
description: 'GitHub token for PR comment access'
8+
required: true
9+
default: ${{ github.token }}
10+
allow-annotation-rules:
11+
description: 'Comma-separated list of clippy rules to track'
12+
required: false
13+
default: 'unwrap_used,expect_used,todo,unimplemented,panic,unreachable'
14+
base-branch:
15+
description: 'Base branch to compare against'
16+
required: false
17+
default: 'origin/main'
18+
log_level:
19+
description: 'Log level (error, warn, info, debug, trace)'
20+
required: false
21+
default: 'info'
22+
23+
runs:
24+
using: 'composite'
25+
steps:
26+
- name: Set up Rust
27+
shell: bash
28+
run: rustup install stable && rustup default stable
29+
30+
- name: Fetch all branches
31+
shell: bash
32+
run: |
33+
git fetch --all
34+
echo "Available branches:"
35+
git branch -a
36+
37+
- name: Build annotation reporter
38+
shell: bash
39+
run: |
40+
cd ${{ github.action_path }}
41+
cargo build --release
42+
- name: Debug step
43+
shell: bash
44+
run: |
45+
FILE_PATH="data-pipeline/src/trace_exporter/mod.rs"
46+
- name: Run annotation reporter
47+
shell: bash
48+
run: |
49+
${{ github.action_path }}/target/release/clippy-annotation-reporter \
50+
--token "${{ inputs.github-token }}" \
51+
--rules "${{ inputs.allow-annotation-rules }}" \
52+
--repo "${{ github.repository }}" \
53+
--pr "${{ github.event.number }}" \
54+
--base-branch "${{ inputs.base_branch }}"
55+
env:
56+
GITHUB_TOKEN: ${{ inputs.github-token }}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
unstable_features = true
2+
3+
format_macro_matchers = true
4+
format_code_in_doc_comments=true
5+
wrap_comments = true
6+
max_width=100
7+
comment_width=100
8+
doc_comment_code_block_width=100

0 commit comments

Comments
 (0)