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

2.0.0: indent type missing in CLI? #3

Open
lkraav opened this issue May 19, 2021 · 3 comments
Open

2.0.0: indent type missing in CLI? #3

lkraav opened this issue May 19, 2021 · 3 comments

Comments

@lkraav
Copy link

lkraav commented May 19, 2021

Hi. Do I interpret README correctly, it doesn't support detect-intent API object's type field? Any particular reason why not?

@sindresorhus
Copy link
Owner

Currently, it returns the indent itself. You could infer the type yourself.

What is your use-case?

I could maybe add a --verbose (or a better name?) flag that would output:

$ detect-indent --verbose
Type:   Tab
Amount: 2

@lkraav
Copy link
Author

lkraav commented May 19, 2021

What is your use-case?

I was trying to figure out for a legacy mixed indent codebase, what is the predominant indent type used.

So after monkey-patching detect-indent for const {type}, I ran something like

$ find src/ -type f -printf '%p ' -exec detect-indent {} \; -exec echo \;

Of course, it turned out false space-positives were identified, because of file header block comments having a single space indent.

/**
 * Comment
 *
 * @todo Moar.
 */
function() {
<tab>yah();

<tab>...

}

@lkraav
Copy link
Author

lkraav commented Feb 10, 2023

Tried again in 2023 to understand whether a file is predominantly Tabs or Spaces, but I guess no luck with moving a verbose mode forward?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants