question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RE: Add output when no files match

See original GitHub issue

I’ve just added lint-staged as we currently have a pre-push hook that takes a while and isn’t that intuitive, i figured if we could do it with this instead it might speed up our process a bit.

It’s working nicely so far but the output can be very noisy, i think it is in relation to #135. I do like the idea of #135 but it seems to give me a comment for each file it iterates over. Would it be possible to just have 1 [skipped] message for the whole commit instead of a per file basis?

I’m not 100% sure if it is per file as the *.py and *.css messages aren’t duplicated.

package.json

  "scripts": {
    "dev": "gulp",
    "build": "gulp production",
    "lint:css": "stylelint \"onespacemedia/{assets/**,apps/*/assets/css}/*.css\"",
    "lint:js": "eslint --ext .js,.vue onespacemedia/assets/js/**/*.js",
    "lint-staged": "lint-staged"
  },
  "lint-staged": {
    "*.js": ["eslint --ext .js,.vue --fix", "git add"],
    "*.css": "stylelint",
    "*.py": ["pylint --load-plugins pylint_django,pylint_mccabe --ignore=migrations,tests -d missing-docstring,invalid-name,no-init,too-many-ancestors,no-member,line-too-long,attribute-defined-outside-init,too-few-public-methods,no-self-use,unused-argument,protected-access,locally-disabled,duplicate-code,fixme --reports=n", "isort --check-only --diff --quiet --skip-glob=.venv --skip-glob=node_modules --skip-glob=*/migrations/*"]
  },
  "pre-commit": "lint-staged",

Terminal output

❯ g s                                                                                                                         (env: onespacemedia) 
On branch develop
Your branch is up-to-date with 'origin/develop'.
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        modified:   onespacemedia/apps/sections/models.py
        modified:   onespacemedia/apps/sections/templates/sections/types/content-careers.html
        modified:   onespacemedia/apps/sections/templates/sections/types/content-double-testimonial.html
        modified:   onespacemedia/apps/sections/templates/sections/types/content-double-text-editor.html
        modified:   onespacemedia/apps/sections/templates/sections/types/content-industries.html
        modified:   onespacemedia/apps/sections/templates/sections/types/content-latest-news.html
        modified:   onespacemedia/apps/sections/templates/sections/types/content-logo-grid.html
        modified:   onespacemedia/apps/sections/templates/sections/types/content-logo-strip.html
        modified:   onespacemedia/apps/sections/templates/sections/types/content-people.html
        modified:   onespacemedia/apps/sections/templates/sections/types/heroes-homepage-hero.html
        modified:   onespacemedia/apps/sections/templates/sections/types/heroes-landing-hero.html
        modified:   onespacemedia/apps/sections/templates/sections/types/text-text-and-carousel.html
        modified:   onespacemedia/apps/sections/templates/sections/types/text-text-and-lists.html
        modified:   onespacemedia/apps/sections/templates/sections/types/text-text-image-and-icons.html
        modified:   onespacemedia/apps/site/templatetags/site.py
        modified:   onespacemedia/assets/css/markdown/markdown.css
        modified:   package.json
        modified:   yarn.lock

                                                                                                                                                    
~/Workspace/onespacemedia develop*
❯ ga .                                                                                                                        (env: onespacemedia) 
                                                                                                                                                    
~/Workspace/onespacemedia develop*
❯ g commit -m "Let section title's be able to use Markdown"                                                                   (env: onespacemedia) 
Alias tip: gcmsg "Let section title's be able to use Markdown"
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 ↓ Running tasks for *.js [skipped]
   β†’ No staged files match *.js
 βœ” Running tasks for *.css
 βœ” Running tasks for *.py
[develop bbd470e] Let section title's be able to use Markdown
 18 files changed, 269 insertions(+), 23 deletions(-)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
iplandcommented, May 22, 2017

@dan-gamble I came across the same problem 😭 , but I fix thatπŸ˜„.

  1. npm uninstall --save-dev husky pre-commit lint-staged.
  2. npm install --save-dev husky lint-staged.
  3. Configuration like below.
  "scripts": {
    "precommit": "lint-staged"
  },
  "lint-staged": {
    "*.{js,jsx}": ["eslint --fix", "git add"]
  },

Hope that it helps.

0reactions
dan-gamblecommented, May 22, 2017

Thanks @ipland what on there do you think was causing the problem?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add output "non_assigned" when there is no match in ...
This will do the job: for p in $(<input.txt) do (COMMAND $p | grep -w "phylum") || echo "non_assigned" done >> results.txt.
Read more >
Can I make `find` return non-0 when no matching files are ...
If your goal is to pass the list of filenames to a command that behaves poorly when given no arguments, a handy trick...
Read more >
ls - List files not matching given string in filename
This will just print the names, you can add -ls to make a ls -l style output with timestamp and permissions, or use...
Read more >
Ack Cheat Sheet - Kapeli
-L, --files-without-matches. Only print filenames with no matches. --output=expr. Output the evaluation of expression for each line.
Read more >
Control-M Advanced File Transfer jobs are not failing (ENDED ...
Prior to upgrading to AFT 8.2.00, the message "No matching files for pattern" was present in the output, but it is no longer...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found