feat: implement pr_missing_newline lint and fix build#10
Closed
ShigrafS wants to merge 4 commits intoRust-for-Linux:trunkfrom
Closed
feat: implement pr_missing_newline lint and fix build#10ShigrafS wants to merge 4 commits intoRust-for-Linux:trunkfrom
ShigrafS wants to merge 4 commits intoRust-for-Linux:trunkfrom
Conversation
Remove manual 'register_tool(klint)' attributes as they are already injected by the test harness, preventing 'already registered' errors during test execution.
- Allow ustc::implicit_sysroot_crate_import in src/main.rs to support racing, itertools, and hiserror from sysroot. - Allow ustc::potential_query_instability in src/infallible_allocation.rs and src/monomorphize_collector.rs for deterministic iteration order issues.
Member
|
Sorry, I am not interested in reviewing AI slop |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes: #9
Description
This PR introduces a new lint
pr_missing_newlinethat detectspr_*logging macro calls without a trailing"\n". Proper newline termination in kernel-style logging is essential to prevent concatenated or malformed log output.Key goals achieved:
pr_*macros (excludingpr_cont) for missing trailing newlines.klintso it runs alongside existing lints.pr_*calls.Acceptance Criteria Fulfillment
PrMissingNewlinelint and registered it as an early lint inklint.pr_*calls without trailing"\n", exceptpr_cont.tests/ui/pr_missing_newline.rsvalidating proper detection.Changes Summary
New Lint:
pr_missing_newlineimplemented insrc/hir_lints/pr_missing_newline.rs.Lint Registration: Registered in
src/main.rsunder early lints.Tests: Added
tests/ui/pr_missing_newline.rscovering:pr_contcalls → exemptBuild/Test Fixes:
src/main.rsand other modulesMinor Dependency Updates: Updated
Cargo.toml/Cargo.lockas needed for build/test stability.Limitations (Experimental Phase)
pr_*usage patterns; unusual token streams could bypass detection.pr_contas per kernel logging conventions.How to Test
Run all tests to ensure nothing breaks:
cargo testCheck the UI test specifically:
cargo test --test compile-testAdd a
pr_*macro without a trailing newline in any Rust file, and confirm thatklintwarns appropriately.