-
Notifications
You must be signed in to change notification settings - Fork 16
fix: make snakemake variable colorful in functions ... #44
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
base: master
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThe changes standardize formatting and update documentation and syntax definitions for the Snakemake project. The launch configuration now uses spaces instead of tabs for the Changes
Suggested labels
Suggested reviewers
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. 🪧 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
syntaxes/snakemake.tmLanguage.json (1)
162-176
: Review of the Quotessmall Pattern Configuration
Thequotessmall
block now delegates string handling to#quoteall
and further includes#snakemakenames
. While this structure is consistent with the new model, consider verifying that the naming conveys the intended hierarchy to future maintainers.src/yaml/snakemake.syntax.yaml (2)
7-7
: Removal of Shellzone Inclusion
Commenting out (or removing) the"#shellzone"
inclusion simplifies the overall patterns list. Verify that shell command highlighting is still addressed within another part of the syntax definitions.
78-84
: Structure for Small Quotes
Thequotessmall
block now uses an inclusion-based approach (referencing#quoteall
and#snakemakenames
) to handle smaller quoted strings in a consistent manner.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.vscode/launch.json
(1 hunks)README.md
(1 hunks)src/yaml/snakemake.syntax.yaml
(4 hunks)syntaxes/snakemake.tmLanguage.json
(10 hunks)
🔇 Additional comments (39)
.vscode/launch.json (1)
6-6
: Indentation Standardization: Using Spaces Instead of Tabs
Changing the indentation for the"version"
attribute to spaces improves consistency across configuration files. This update is purely stylistic and does not affect functionality.README.md (2)
29-41
: Clearer Documentation for Keywords and Functions
Linking the "Keywords and Functions" header directly tosrc/keywords.yaml
enhances discoverability and clarifies where users can find the syntax definitions. The accompanying explanations and code examples make it easier to understand the expected format in a snakefile.
104-108
: Expanded TODO Section for Future Enhancements
The updated TODO list now includes tasks to recognize file strings after keywords (likeinclude:
,conda
,snakefile
) and to add bash coloring to docstrings within theshell:
block. These items clearly lay out future improvement directions and help maintain a forward-looking roadmap.syntaxes/snakemake.tmLanguage.json (18)
10-10
: Addition of Snakestrings Pattern
Including"#snakestrings"
in the patterns array consolidates string handling by replacing the previous multiple quote patterns. This change improves maintainability and ensures consistency throughout the syntax file.
40-40
: Integration of Function Call Pattern
Adding the"#function-call"
pattern into the overall patterns array ensures that function calls are detected and highlighted correctly. This contributes to more accurate syntax parsing.
43-43
: Consolidating String Handling with #quoteall
The inclusion of"#quoteall"
helps centralize the handling of quoted strings, replacing the older separate quote patterns. This consolidation leads to a simpler and more unified approach.
46-46
: Enhanced Recognition with #snakemakenames
Introducing"#snakemakenames"
aids in better recognizing identifiers (such as classes, rules, or functions) within Snakemake scripts, aligning with the updated syntax rules.
53-80
: Refactored Function Call Pattern
Thefunction-call
block now clearly defines the regular function call syntax with well-structured boundaries and nested includes (for classes, functions, special variables, etc.). This improves both clarity and maintainability.
81-148
: Robust Function Arguments Pattern
Thefunction-arguments
block is comprehensive—it handles argument separation, unpacks operators, and includes validation for assignments. Its use of nested includes for names and expressions covers a broad set of scenarios reliably.
149-161
: Maintaining Legacy Quote Patterns via #quoteall
Although thequoteall
pattern still references the older quote patterns (#quotessmall
,#quotesmid
,#quotesbig
), this design ensures backward compatibility while transitioning to the new unified strings approach.
177-191
: Consistent Configuration for the Quotes Mid Pattern
Thequotesmid
pattern is set up in the same fashion as the other quote blocks, ensuring that medium-length strings are parsed consistently.
192-206
: Consistent Configuration for the Quotes Big Pattern
Thequotesbig
block follows the established pattern by including#quoteall
and#snakemakenames
, which helps correctly parse larger string constructs.
187-194
: Introduced snakemakenames Pattern in Repository
The newsnakemakenames
block aggregates various includes (classes, rules references, objects, rule arguments, and functions) to streamline identifier recognition. This is a helpful addition for maintaining a consistent syntax highlighting scheme.
351-361
: Rules Reference Pattern Accuracy
Therulesrefernce
block accurately captures rule and checkpoint references (e.g.,rules.<identifier>
), ensuring that these elements are clearly highlighted.
363-370
: Object Identifiers Highlighting
Theobjects
block is succinct and effectively marks well-known Snakemake entities (likesnakemake
,rules
, etc.), aiding in their immediate identification.
372-382
: Function Rule Argument Pattern Improvement
Theruleargargs
block is refined to capture rule-specific arguments with improved naming specificity, ensuring that these elements are highlighted uniformly.
384-391
: Consistent Rule Arguments Capture
Theruleargs
block standardizes how rule arguments are recognized, resulting in reliable and consistent highlighting across Snakemake scripts.
392-399
: Efficient Built-in Function Highlighting
Thefunctions
block clearly specifies a regex to capture built-in Snakemake functions. This ensures that key functionalities are easily distinguishable within the code.
400-425
: Enhanced Snakestrings Pattern for Docstrings
The newly introducedsnakestrings
pattern consolidates various string quoting styles (including docstrings) and sets clear boundaries for string definitions, thereby improving syntax accuracy.
426-440
: Embedded Shell Command Highlighting
Theshellzone
block correctly identifies and scopes shell command sections within Snakemake files. Its use of thewhile
clause ensures proper handling of nested shell fragments.
441-460
: Dedicated Pattern for Shell Strings
Thesnakeshellstrings
block is well-configured to handle shell-specific string constructs. It preserves proper string delimiters as found in Python, ensuring that embedded shell strings are highlighted correctly.src/yaml/snakemake.syntax.yaml (18)
8-8
: Addition of Snakestrings Pattern
Adding"#snakestrings"
to the patterns list in the YAML file aligns this file with the TM Language JSON updates and centralizes string handling.
18-18
: Integration of Function Call Pattern
The inclusion of"#function-call"
in the YAML file ensures that function call constructs are parsed consistently with the JSON definition, enhancing overall syntax support.
19-19
: Utilization of Unified Quote Handling with #quoteall
Switching to the"#quoteall"
pattern replaces the older segmented quote patterns, resulting in a more streamlined approach to parsing various string literals.
20-20
: Enhanced Identifier Recognition with #snakemakenames
The addition of"#snakemakenames"
improves the recognition of identifiers across the syntax, aligning with the new approach taken in the JSON file.
24-41
: Refined Function Call Pattern in YAML
Thefunction-call
block now clearly defines how function calls are recognized, including a comment that clarifies its purpose. Nested includes (for classes, functions, and special variables) reinforce consistency with the overall syntax rules.
73-77
: Unified Quote Handling Using #quoteall
Thequoteall
block aggregates the previously separate quote patterns into one unified structure. This change simplifies future maintenance and ensures consistent string parsing across the file.
85-91
: Configuration for Medium Quotes
Thequotesmid
pattern is configured similarly to the other quote blocks, ensuring that medium-length strings adhere to the same parsing rules for improved consistency.
92-98
: Configuration for Big Quotes
Thequotesbig
block mirrors the configuration of the smaller quote patterns, ensuring that even larger string structures are handled reliably.
187-194
: Introduced snakemakenames Pattern
The newsnakemakenames
block consolidates various identifier includes (classes, rules references, objects, and functions), which streamlines the colorization of identifiers throughout Snakemake scripts.
195-199
: Classes Pattern Verification
Theclasses
block uses a clear regex to match class-like identifiers, ensuring these entities are highlighted consistently.
200-205
: Accurate Rules Reference Matching
Therulesrefernce
block is designed to detect patterns such asrules.<identifier>
, providing precise highlighting for rule or checkpoint references.
206-210
: Object Recognition Enhancements
Theobjects
block effectively identifies key Snakemake objects, helping differentiate them from other identifiers in the code.
211-216
: Rule Arguments with Additional Detail
Theruleargargs
block captures compound expressions (such asinput.variable
), improving clarity when multiple argument references are in play.
217-220
: Concise Rule Arguments Matching
Theruleargs
block provides a streamlined pattern for recognizing rule arguments, which contributes to a consistent highlighting strategy.
221-224
: Consistent Function Highlighting
Thefunctions
block matches and highlights built-in functions in a manner that is easy to read and maintain, following the improvements made in the JSON syntax file.
225-237
: Introduction of snakestrings for Docstrings
The newsnakestrings
block centralizes the handling of various quoted strings (including docstrings) and defines clear start/end boundaries, thereby enhancing the accuracy of string highlighting.
238-244
: Handling Embedded Shell Commands
Theshellzone
block is correctly defined to capture embedded shell command regions, ensuring that such sections are parsed with their proper context and indentation maintained.
245-256
: Embedded Shell String Extraction
Thesnakeshellstrings
block provides a dedicated mechanism to handle shell-specific quoted strings, aligning with the syntax and formatting guidelines of embedded shell code.
... and also make string without assignment (so called 'docstring' in python syntaxes) as colorful as other strings.
The README is updated as well and more descriptions about the keywords are added
Summary by CodeRabbit
Documentation
New Features