Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Rules for space indentation instead of tabs, specifically in multiline arrays #2448

Closed
1 task
pdewouters opened this issue May 30, 2024 · 5 comments
Closed
1 task

Comments

@pdewouters
Copy link

pdewouters commented May 30, 2024

Is your feature request related to a problem?

Enforcing spaces for indentation

Describe the solution you'd like

I want to introduce WP standards in a codebase that is using spaces for indentation, so instead of converting all indentation to tabs, I'd like to enforce 2 spaces as per existing style.
this config gets me nearly there https://gist.github.com/pdewouters/39d6b4f1c2d60e5c1538163774c8ed18

But I still get some errors related to array indentation, it thinks it should be 4 spaces instead of 2.

function update_admin_labels() {
  wp_register_script(
    'update-some-admin-labels-js',
    plugins_url( 'my-plugin/js/update-some-admin-labels.js' ),
    [
      'wp-plugins',
      'wp-edit-post',
      'wp-element',
      'wp-components',
      'wp-i18n',
    ],
    1
  );
}
add_action( 'init', 'pdate_admin_labels' );

Additional context (optional)

See screenshot: the first line has no errors because it has 4 spaces indent but the next ones throw an error. It should be the reverse

Screenshot 2024-05-30 at 13 27 49

  • I intend to create a pull request to implement this feature.
@jrfnl
Copy link
Member

jrfnl commented Jun 2, 2024

@pdewouters As is clearly mentioned in the templates: please do not post screenshots, post a code sample the report can be tested with.

As things are, this is not actionable.

@dingo-d
Copy link
Member

dingo-d commented Jun 3, 2024

This looks like a discussion topic, not an issue with WPCS. Can you open this as a discussion instead @pdewouters ?

@dingo-d dingo-d closed this as not planned Won't fix, can't repro, duplicate, stale Jun 3, 2024
@pdewouters
Copy link
Author

@dingo-d where are the discussions?

@dingo-d
Copy link
Member

dingo-d commented Jun 3, 2024

@pdewouters
Copy link
Author

I do now, thanks

@WordPress WordPress locked and limited conversation to collaborators Jun 5, 2024
@dingo-d dingo-d converted this issue into discussion #2449 Jun 5, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
3 participants