Skip to content

Conversation

tcharding
Copy link
Member

Add and enforce policy around import statements using crate::Foo instead of units::Foo.

@tcharding
Copy link
Member Author

The github basebranch stuff smells a bit.

fi

for crate in "${crates[@]}"; do
violations=$(git diff "$base_branch"...HEAD | grep "^+" | grep -E "use ${crate}::" | grep -v "pub use ${crate}::" || true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we limit this rule to only *.rs files, so it doesn’t apply to documentation or *.md files ?

git diff "$base_commit"...HEAD -- '*.rs'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that is a good idea.

@apoelstra
Copy link
Member

Needs rebase after #4895 (remove coveralls)

Recently we have started documenting repository coding policy in
`docs/policy.md` to help contributors.

Introduce a script that can be used to enforce the policy rules. At
this stage only enforce a subsection of import statement policy.
Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK c0f5db2; successfully ran local tests; let's give this a shot

@apoelstra apoelstra merged commit 567b50a into rust-bitcoin:master Sep 8, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants