-
Notifications
You must be signed in to change notification settings - Fork 15
clippy annotation reporter #1049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ekump
wants to merge
5
commits into
main
Choose a base branch
from
ekump/clippy-annotation-action
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
89037c4
initial setup of clippy-annotation-reporter github action.
ekump 1ef0359
add the analyzer module to clippy-annotation-reporter. This module
ekump d855eee
add the config module to clippy-annotation-reporter. This module
ekump 5dcd2ad
add the commenter module to clippy-annotation-reporter. This takes the
ekump 0a96a8f
add the reporter module to clippy-annotation-reporter. This uses the
ekump File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2,935 changes: 2,935 additions & 0 deletions
2,935
.github/actions/clippy-annotation-reporter/Cargo.lock
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[package] | ||
name = "clippy-annotation-reporter" | ||
rust-version = "1.78.0" | ||
edition = "2021" | ||
version = "0.1.0" | ||
|
||
[dependencies] | ||
clap = { version = "4.3", features = ["derive", "env"] } | ||
octocrab = "0.44" | ||
anyhow = "1.0" | ||
regex = "1.9" | ||
tokio = { version = "1", features = ["macros", "rt-multi-thread"] } | ||
serde_json = "1.0" | ||
log = "0.4" | ||
env_logger = "0.10" | ||
# 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. | ||
url = "=2.5.2" | ||
toml = "0.8.22" | ||
mockall = "0.13.1" | ||
|
||
[dev-dependencies] | ||
httpmock = "0.6" | ||
http = "1.1.0" | ||
tempfile = "3.20.0" | ||
|
||
# TODO: Remove this when move to separate repo | ||
[workspace] | ||
members = ["."] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: 'Clippy Annotation Reporter' | ||
description: 'Reports changes in Clippy allow annotations' | ||
author: 'Datadog' | ||
|
||
inputs: | ||
github-token: | ||
description: 'GitHub token for PR comment access' | ||
required: true | ||
default: ${{ github.token }} | ||
allow-annotation-rules: | ||
description: 'Comma-separated list of clippy rules to track' | ||
required: false | ||
default: 'unwrap_used,expect_used,todo,unimplemented,panic,unreachable' | ||
base-branch: | ||
description: 'Base branch to compare against' | ||
required: false | ||
default: 'origin/main' | ||
log_level: | ||
description: 'Log level (error, warn, info, debug, trace)' | ||
required: false | ||
default: 'info' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Set up Rust | ||
shell: bash | ||
run: rustup install stable && rustup default stable | ||
|
||
- name: Fetch all branches | ||
shell: bash | ||
run: | | ||
git fetch --all | ||
echo "Available branches:" | ||
git branch -a | ||
|
||
- name: Build annotation reporter | ||
shell: bash | ||
run: | | ||
cd ${{ github.action_path }} | ||
cargo build --release | ||
- name: Debug step | ||
shell: bash | ||
run: | | ||
FILE_PATH="data-pipeline/src/trace_exporter/mod.rs" | ||
- name: Run annotation reporter | ||
shell: bash | ||
run: | | ||
${{ github.action_path }}/target/release/clippy-annotation-reporter \ | ||
--token "${{ inputs.github-token }}" \ | ||
--rules "${{ inputs.allow-annotation-rules }}" \ | ||
--repo "${{ github.repository }}" \ | ||
--pr "${{ github.event.number }}" \ | ||
--base-branch "${{ inputs.base_branch }}" | ||
env: | ||
GITHUB_TOKEN: ${{ inputs.github-token }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
unstable_features = true | ||
|
||
format_macro_matchers = true | ||
format_code_in_doc_comments=true | ||
wrap_comments = true | ||
max_width=100 | ||
comment_width=100 | ||
doc_comment_code_block_width=100 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how this is usually done, but should we cache the binary as it probably won't change very often.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build time relative to the rest of CI is very short. I don't think it's an issue in the short-term. Once we move this to a separate repo the action should be pre-built.