fix: Inconsistent Linting Output Formatting#3064
Conversation
WalkthroughThe changes involve an update to the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
There was a problem hiding this comment.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- snakemake/linting/init.py (1 hunks)
Additional context used
Path-based instructions (1)
snakemake/linting/__init__.py (1)
Pattern
**/*.py: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of theselfargument of methods.
Do not suggest type annotation of theclsargument of classmethods.
Do not suggest return type annotation if a function or method does not contain areturnstatement.
Additional comments not posted (1)
snakemake/linting/__init__.py (1)
74-86: LGTM!The refactoring of the
__str__method in theLintclass looks good:
- The return type annotation
-> stris correct and follows the additional instructions.- The refactoring improves the readability and maintainability of the method by building the output string in a more structured manner.
- The conditional appending of the links section ensures that the links are only displayed when applicable, which optimizes the output format and avoids unnecessary blank lines.
- The changes maintain the original intent of the method.
🤖 I have created a release *beep* *boop* --- ## [8.20.0](v8.19.3...v8.20.0) (2024-09-07) ### Features * allow skipping apptainer and conda tests if not available ([#3074](#3074)) ([c3cd4e0](c3cd4e0)) * MANIFEST.in: include tests/ in sdist ([#3073](#3073)) ([e24f3fc](e24f3fc)) ### Bug Fixes * add subfolders of report template to package data ([14a8f22](14a8f22)) * Inconsistent Linting Output Formatting ([#3064](#3064)) ([90e51ae](90e51ae)) * retry when downloading assets ([58e41b0](58e41b0)) * skip asset download if files are already present ([#3076](#3076)) ([0d3d1e1](0d3d1e1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>



While writing a parser for the output of
snakemake --lint, I noticed that the output formatting is not always consistent. The hints usually end inAlso see:\n<topical link>\n, however, for some, there are no links to be displayed, and then they end inAlso see:\n\n.This can be confusing to read depending on the context and it complicates parsing the linter output by adding stray newlines.
I fixed this by removing
Also see:\nfrom the output if there are no links to display.QC
No changes to tests and docs, let me know if you deem this necessary.
docs/) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake).Summary by CodeRabbit