Skip to content

Conversation

cmoussa1
Copy link
Member

@cmoussa1 cmoussa1 commented Sep 4, 2024

Problem

The function descriptions for append_hostname() and sort_nodes() could use some better descriptions. sort_nodes() as a whole could probably use some improvement via condensing it down.


This PR edits the descriptions for both helper functions and remove the extra whitespace between the function description and the start of the function definition.

Specifically, in sort_nodes():

  • simplify the string processing by checking "nodelist" directly
    instead of assigning it to another variable.
  • add an extract_key() function to extract the prefix, numeric part,
    and suffix using regex and return a tuple of it.
  • use the returned tuple from extract_key() to sort the original
    nodelist by prefix, numeric part, and suffix.

Problem: The function descriptions for append_hostname() and
sort_nodes() could use some better descriptions. sort_nodes() as a
whole could probably use some improvement via condensing it down.

Edit the descriptions for both helper functions and remove the extra
whitespace between the function description and the start of the
function definition.

In sort_nodes():

- simplify the string processing by checking "nodelist" directly
instead of assigning it to another variable.
- add an extract_key() function to extract the prefix, numeric part,
and suffix using regex and return a tuple of it.
- use the returned tuple from extract_key() to sort the original
nodelist by prefix, numeric part, and suffix.
@cmoussa1 cmoussa1 added the improvement improving existing functionality or features label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement improving existing functionality or features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant