Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Consistently sort output YAML #10

Merged
merged 2 commits into from
Jan 21, 2022

Conversation

mcdonnnj
Copy link
Member

🗣 Description

This pr updates the convert-cisagov command to sort the software entries in the converted Markdown's YAML output by vendor and then product. It also updates the sorting functionality in the normalize-yml to sort in the same manner.

💭 Motivation and context

This most human-friendly sorting is that which sorts on two values plainly instead of combining them. Since Python allows that with its sorting it is better to switch to that method for output. Just for a consistent experience the initial converted output from convert-cisagov is updated to be sorted the same way.

🧪 Testing

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All new and existing tests pass.

Sort the entries in each group of converted entries by vendor and then
product. Both are converted to lowercase to create a case-insensitive
sort. This will provide the most human-friendly sort.
Update the sort rules in the normalize-yml command to be consistent
with the sorting done in the convert-cisagov command. That is to sort
by vendor and then product for a human-friendly sorted output.
@mcdonnnj mcdonnnj added the improvement This issue or pull request will add new or improve existing functionality label Jan 20, 2022
@mcdonnnj mcdonnnj self-assigned this Jan 20, 2022
@coveralls
Copy link

Pull Request Test Coverage Report for Build 1725858893

  • 0 of 1 (0.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-5.6%) to 24.026%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/yml/normalize_yml.py 0 1 0.0%
Totals Coverage Status
Change from base Build 1725771229: -5.6%
Covered Lines: 103
Relevant Lines: 343

💛 - Coveralls

Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🦖

Copy link
Member

@jsf9k jsf9k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@mcdonnnj mcdonnnj merged commit a084400 into v1.1.1 Jan 21, 2022
@mcdonnnj mcdonnnj deleted the improvement/consistently_sort_yaml_files branch January 21, 2022 16:34
@mcdonnnj mcdonnnj mentioned this pull request Jan 24, 2022
8 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
improvement This issue or pull request will add new or improve existing functionality
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants