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

beautify.js doesn't have indent_level option #724

Closed
Hirse opened this issue Jun 24, 2015 · 3 comments · Fixed by #1525
Closed

beautify.js doesn't have indent_level option #724

Hirse opened this issue Jun 24, 2015 · 3 comments · Fixed by #1525
Milestone

Comments

@Hirse
Copy link
Contributor

Hirse commented Jun 24, 2015

In the options documentation I found the setting indent_level as Initial indentation level for both CLI and underscored option.

However when using it in the js version, the setting seems to be ignored.
When checking the code, it seems like it should be included somewhere here, but it isn't.

@Hirse Hirse changed the title beautify.js doesn' beautify.js doesn't have indent_level option Jun 24, 2015
@bitwiseman
Copy link
Member

Another good report, thanks!
Until this is fixed, you can do workaround this by adding the text of the indent you want to the beginning of the file(s).

For example, before:

    // Top of file
    if (test) 
a();
b();

After:

    // Top of file
    if (test)
        a();
    b();

@thoger
Copy link
Contributor

thoger commented Jan 5, 2018

FWIW, this is also applicable to the python CLI. It also accepts the -l / --indent-level option, but ignores it completely.

@MacKLess
Copy link
Collaborator

MacKLess commented Sep 1, 2018

I've just submitted a PR addressing this issue. One aspect (the ability to set the indent level at zero in the CSS and JavaScript); however, is not functional. I'll be filing an issue for this specific issue.

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

Successfully merging a pull request may close this issue.

4 participants