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

Show error if run on a single file that's ignored #238

Open
OmgImAlexis opened this issue Jul 4, 2017 · 7 comments
Open

Show error if run on a single file that's ignored #238

OmgImAlexis opened this issue Jul 4, 2017 · 7 comments
Labels
💵 Funded on Issuehunt This issue has been funded on Issuehunt enhancement help wanted

Comments

@OmgImAlexis
Copy link
Contributor

OmgImAlexis commented Jul 4, 2017

Issuehunt badges

When using xo on a single file no errors are shown if said file is ignored in xo's settings.

➜  agenda git:(master) DEBUG=xo xo test/fixtures/addTests.js 
  xo Using local install of XO. +0ms
➜  agenda git:(master) mv test/fixtures/addTests.js .
➜  agenda git:(master) ✗ DEBUG=xo xo ./addTests.js            
  xo Using local install of XO. +0ms

  addTests.js:1:1
  ✖   1:1   Filename is not in kebab case. Rename it to add-tests.js.     unicorn/filename-case
  ✖   2:3   Strings must use singlequote.                                 quotes
  ✖   2:3   Extra space after key none.                                   key-spacing

There is a $30.00 open bounty on this issue. Add more on Issuehunt.

@sindresorhus
Copy link
Member

Makes sense. Wanna try doing a pull request?

@kevva
Copy link
Contributor

kevva commented Jul 8, 2017

On a single file, or all files that is directly called (i.e. not globbed) using the CLI?

@OmgImAlexis
Copy link
Contributor Author

I would open a PR but I have no clue where to put this type of check.

@sindresorhus
Copy link
Member

@kevva We could do it for all specified non-glob inputs. The only way to really detect whether something is a glob or a direct file reference is to fs.existsSync().

@IssueHuntBot
Copy link

@issuehuntfest has funded $30.00 to this issue. See it on IssueHunt

@IssueHuntBot
Copy link

@Norris1z has submitted a pull request. See it on IssueHunt

@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label May 10, 2019
@fisker
Copy link
Contributor

fisker commented Aug 8, 2021

We only need to test that pattern is a file and check if it's ignored.

This should be very easy to fix now, because I've marked ignored file in report

isIgnored: true,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💵 Funded on Issuehunt This issue has been funded on Issuehunt enhancement help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants