Skip to content

Indent options files to two spaces #2010

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bgilbert
Copy link
Collaborator

@bgilbert bgilbert commented Apr 2, 2025

#1975 indented them to four spaces, which is inconsistent with the settings for meson.build.

@eli-schwartz
Copy link
Member

IMHO 4 spaces is a nice default and maybe we should just be consistent about that. It's also the same one python uses.

@bgilbert
Copy link
Collaborator Author

bgilbert commented Apr 2, 2025

The Meson docs seem to consistently use two spaces for meson.build example code. While the docs don't seem to have an opinion for options files, it feels inconsistent to have a different convention there.

@eli-schwartz
Copy link
Member

eli-schwartz commented Apr 2, 2025

Yes but I am opinionated and think the docs made a mistake. :P

What would the world be without opinion about "tabs vs spaces? 2 spaces or 4?" anyway.

Note as well that I believe the formatter defaults to it.

@bgilbert
Copy link
Collaborator Author

bgilbert commented Apr 2, 2025

I'm actually not a fan of two-space indents, but there's some value in being minimally confusing.

Since the indentation part is controversial, I'll break out the fixup commits into a separate PR.

@bgilbert bgilbert changed the title Indent options files to two spaces; minor fixups Indent options files to two spaces Apr 2, 2025
@jpakkane
Copy link
Member

jpakkane commented Apr 2, 2025

Two spaces was my mistake. Four would be better because that is what everybody else uses by default.

@Totto16
Copy link
Contributor

Totto16 commented Apr 2, 2025

The .editorconfig says:

[*.py]
indent_size = 4

[meson.build]
indent_size = 2

so adjust it there too

@dcbaker
Copy link
Member

dcbaker commented Apr 2, 2025

I'm a big fan of two space indent and not a fan of 4 space indent, and I have at least one practical reason for liking it:

if (really_long conditional
    that goes more than one line)
    'What this is unclear!'
endif

if (long
    line 2)
  'this is more readable'
endif

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

Successfully merging this pull request may close these issues.

6 participants