Skip to content
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

Adding logging for when no files match a pattern. #139

Merged
merged 3 commits into from Mar 13, 2017

Conversation

Noirbot
Copy link
Contributor

@Noirbot Noirbot commented Mar 13, 2017

This is an initial attempt at a solution for #135. In short, I'm adjusting the generateTasks function so it doesn't filter out patterns with no matching files, and then adding a special case for tasks with no files found.

There's another option for this that involves just adding the logging to the generateTasks function, which could keep the main method a little less complicated if that's preferred.

I'm also noticing that there seems to be an inconsistency between the check character that lint-staged uses, , and the one that Listr seems to use, . This isn't a new problem, but it does look a little odd now:

screen shot 2017-03-13 at 1 26 56 pm

@codecov
Copy link

codecov bot commented Mar 13, 2017

Codecov Report

Merging #139 into master will decrease coverage by 0.5%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #139      +/-   ##
==========================================
- Coverage   90.24%   89.74%   -0.51%     
==========================================
  Files           3        3              
  Lines          41       39       -2     
  Branches        6        5       -1     
==========================================
- Hits           37       35       -2     
  Misses          4        4
Impacted Files Coverage Δ
src/generateTasks.js 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3acd6c7...753d2c7. Read the comment docs.

@okonet
Copy link
Collaborator

okonet commented Mar 13, 2017

I think we should use https://github.com/SamVerschueren/listr#skipping-tasks for that. It should keep the code cleaner. Can you try it out?

@Noirbot
Copy link
Contributor Author

Noirbot commented Mar 13, 2017

Nicely, that also seems to fix the checkmark issue.

@okonet
Copy link
Collaborator

okonet commented Mar 13, 2017

@Noirbot nice! Can you post a screenshot of how it looks like now?

@Noirbot
Copy link
Contributor Author

Noirbot commented Mar 13, 2017

screen shot 2017-03-13 at 1 48 18 pm

I'm not super happy about skips looking like failures, but it's not a huge issue. Some output beats no output. I'll look through Listr and see if there's a way to skip while marking as successful, though, I can see the justification for keeping it this way for clarity.

@okonet
Copy link
Collaborator

okonet commented Mar 13, 2017

Well, they have 3 types: "ok", "skipped" and "failed". I think I like it. I'll merge and release it.

@Noirbot
Copy link
Contributor Author

Noirbot commented Mar 13, 2017

This definitely seems like an improvement in visibility no matter what. I like it.

@okonet okonet merged commit b0204ee into lint-staged:master Mar 13, 2017
@okonet
Copy link
Collaborator

okonet commented Mar 13, 2017

Great work! Thanks for the contribution 👍

@Noirbot Noirbot deleted the 135-No-Found-Files-Logging branch March 24, 2017 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants