chore: configure Codacy to skip assert_used rule in test files#2025
chore: configure Codacy to skip assert_used rule in test files#2025rayank906 wants to merge 5 commits intohiero-ledger:mainfrom
Conversation
WalkthroughAdded a Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📋 Issue PlannerBuilt with CodeRabbit's Coding Plans for faster development and fewer bugs. View plan used: ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 0aae1415-e89e-4ab6-a143-7518405a9767
📒 Files selected for processing (2)
.codacy.ymlCHANGELOG.md
.codacy.yml
Outdated
| - "*_test.py" | ||
| - "*test_*.py" |
There was a problem hiding this comment.
Narrow the glob patterns to avoid suppressing production-file checks.
*test_*.py is too broad and can match non-test filenames that merely contain test_ (for example, latest_*.py), which violates the goal of keeping assert_used active in production code.
Proposed fix
pylint:
enabled: true
rules:
assert_used:
skips:
- - "*_test.py"
- - "*test_*.py"
+ - "**/*_test.py"
+ - "**/test_*.py"
MonaaEid
left a comment
There was a problem hiding this comment.
Hi @rayank906 nice work, could you please apply the coderabbit suggestion, and test it in your fork
d1f5cb4 to
49272e7
Compare
|
Made sure to sync my fork and pushed my changes. I added coderabbit's suggestion as requested. |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: b3cf0053-a3b3-4917-883a-9b7ab944b98c
📒 Files selected for processing (2)
.codacy.ymlCHANGELOG.md
|
Hi @rayank906 it would be great if you could test this and ensure it works properly |
|
Yes I will ensure to test properly. I'll make this PR a draft and convert to an actual PR when I have finished testing. |
Signed-off-by: Rayan Kamdem <rayankdm@umich.edu>
Signed-off-by: Rayan Kamdem <rayankdm@umich.edu>
Signed-off-by: Rayan Kamdem <rayankdm@umich.edu>
Signed-off-by: Rayan Kamdem <rayankdm@umich.edu>
abba14b to
7a604c5
Compare
Signed-off-by: Rayan Kamdem <rayankdm@umich.edu>
exploreriii
left a comment
There was a problem hiding this comment.
Hi @rayank906
Apologies the issue became more difficult than anticipated
I believe this can be resolved by creating a bandit file
https://bandit.readthedocs.io/en/latest/config.html
and disabling that more directly, since codacy is applying bandit.
Although this might lead to conflicts, I think @manishdait is also looking into it -- so requesting his opinion
Description:
Related issue(s):
Fixes #1974
Checklist
cc @exploreriii