-
-
Notifications
You must be signed in to change notification settings - Fork 952
📝 Add docstrings to fix-windows-path-handling
#1174
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -165,6 +165,16 @@ def find_args_value(args_name): | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| def re_address_repeaters_key_name(key_name): | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Note: This uses "/" as a key delimiter, not a file path separator | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Format a slash-delimited key path into a sequence of dictionary-access segments excluding the final key. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Parameters: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| key_name (str): A "/"-delimited key path ("/" is a key delimiter, not a filesystem separator). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Returns: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| str: Concatenated "['key']" segments for every component of `key_name` except the last; returns an empty string if there are no components before the final segment. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return "".join(["['" + _key + "']" for _key in key_name.split("/")[:-1]]) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
167
to
178
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Docstring uses tab indentation instead of 4 spaces. The docstring at lines 172-176 appears to use tab indentation, which violates the coding guideline requiring 4-space indents. This is likely contributing to the ruff-format failure. def re_address_repeaters_key_name(key_name):
# Note: This uses "/" as a key delimiter, not a file path separator
"""
Format a slash-delimited key path into a sequence of dictionary-access segments excluding the final key.
-
+
Parameters:
- key_name (str): A "/"-delimited key path ("/" is a key delimiter, not a filesystem separator).
-
+ key_name (str): A "/"-delimited key path ("/" is a key delimiter, not a filesystem separator).
+
Returns:
- str: Concatenated "['key']" segments for every component of `key_name` except the last; returns an empty string if there are no components before the final segment.
+ str: Concatenated "['key']" segments for every component of `key_name` except
+ the last; returns an empty string if there are no components before the
+ final segment.
"""📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -449,4 +459,4 @@ def generate_compare_filepath(scan_id): | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| return "/report_compare_{date_time}_{scan_id}.json".format( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| date_time=now(format="%Y_%m_%d_%H_%M_%S"), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| scan_id=scan_id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
Docstring line exceeds 99-character limit.
Line 34 is too long and likely contributing to the ruff-format failure. Split the description across multiple lines.
def open(self): """ Return the contents of the YAML module file identified by this loader's name. - - The name is split on underscores to derive an action (last segment) and a library (remaining segments joined with underscores); the file at Config.path.modules_dir / action / f"{library}.yaml" is opened with UTF-8 encoding and its full text is returned. - + + The name is split on underscores to derive an action (last segment) and a library + (remaining segments joined with underscores). The file at + Config.path.modules_dir / action / f"{library}.yaml" is opened with UTF-8 encoding + and its full text is returned. + Returns: str: The raw text of the YAML file. """📝 Committable suggestion
🤖 Prompt for AI Agents