-
Notifications
You must be signed in to change notification settings - Fork 191
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
Modules lint output sorting #2077
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #2077 +/- ##
==========================================
+ Coverage 67.98% 67.99% +0.01%
==========================================
Files 43 43
Lines 5597 5602 +5
==========================================
+ Hits 3805 3809 +4
- Misses 1792 1793 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Not sure about the different shades of the row. It was alternating between rows before, but now seems to group them. Do we need the different shades? @ewels 👀 |
You know I didn't actually notice how that changed, I would need to look at the logic to see how it decides what to highlight. But personally I do like that it seems to highlight the "groups" of rows. I think it alternates highlighting between groups based on the module name. |
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.
Can't remember how the varying colours works now. I added it to try to aid readability, which is pretty poor for this output.
@@ -732,8 +732,16 @@ def create_test_yml(ctx, tool, run_tests, output, force, no_prompts): | |||
@click.option("-w", "--fail-warned", is_flag=True, help="Convert warn tests to failures") | |||
@click.option("--local", is_flag=True, help="Run additional lint tests for local modules") | |||
@click.option("--passed", is_flag=True, help="Show passed tests") | |||
@click.option( |
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.
This is for nf-core modules lint
but maybe you also want it for nf-core lint
?
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.
Added to pipeline linting. Called it sort_by
for consistency across commands but did consider if it should be module_sort_by
in pipeline lint
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.
I personally like sort_by
more, I find module_sort_by
a bit more confusing. Should we merge? are you happy with it @awgymer ?
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.
Ok that's good then. Happy to merge if this gets an approving review
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.
sorry, I thought it was already approved 😅
btw. this is the source for the alternating colors: https://github.com/nf-core/tools/blob/dev/nf_core/modules/lint/__init__.py#L377 |
Indeed it colours rows in grouping of module name. I don't think it was ever guaranteed to be alternating every row. If you (or anyone) has a preference for changing it then happy to implement something different in future but will merge this PR now. |
Oh, we forgot to mention that new option in the changelog. Can you open a PR for that, @awgymer? |
The current
modules lint
behaviour sorts the test messages bymessage
then bymodule_name
(this is done by python string-sorting i.e. alphabetically).Personally I find this somewhat unintuitive to grok.
Current output:
This PR changes the default sort order to use the
lint_test
test name, then themodule_name
, then finally themessage
.It also adds the option to order by
module_name
first. This is a personal preference - feel free to quibble the inclusion.PR checklist
CHANGELOG.md
is updateddocs
is updated