Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Formatting cleanup#12408

Open
danielrainer wants to merge 1 commit intofish-shell:masterfrom
danielrainer:formatting_cleanup
Open

Formatting cleanup#12408
danielrainer wants to merge 1 commit intofish-shell:masterfrom
danielrainer:formatting_cleanup

Conversation

@danielrainer
Copy link

Work towards more consistent formatting and consistency between what's specified in .editorconfig and how the files are actually formatted.

The commits in this PR are fairly independent and can mostly be merged individually.

@krobelus krobelus added this to the fish 4.4 milestone Feb 3, 2026
.editorconfig Outdated
max_line_length = 72

[Dockerfile]
[{Dockerfile,Vagrantfile}]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The top-level Dockerfile is inconsistent with *.Dockerfile,
we should fix that. Either 2 or 4 spaces.
Probably 4 but IDK what's best practice for Dockerfiles (same for CMake files).
I'll let you merge to reduce diff noise.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't seem like there is a strong convention. Indentation in https://docs.docker.com/reference/dockerfile/ is all over the place. I removed the exception for Dockerfiles from our general 4-space indentation convention.

It seems that the main Dockerfile is quite outdated. It does not include any Rust toolchain but instead installs gcc-c++ and vim-common, claiming it's a test dependency, which might have been true 11 years ago when it was added, but I don't think it is now. Basing the image on CentOS also seems like a strange choice now. I tried building the image and it already fails at the first step, due to centos:latest being unavailable. Given that this Dockerfile most likely hasn't been used in years and I don't see any open issues complaining about it being broken, I think we should delete it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For CMake, there also doesn't seem to be strong consensus on how to indent. Some styles use alignment with opening parentheses in preceding lines, other times a fixed indent width is used. Both is shown in https://cmake.org/cmake/help/book/mastering-cmake/chapter/Writing%20CMakeLists%20Files.html#looping-constructs, with no obvious indication when which style is preferred. I'm not a huge fan of using variable indentation since it works worse with tooling integration such as editorconfig and can waste a lot of space. Whether we use 2 or 4 or some other number of spaces for CMake (and Dockerfiles) does not really matter to me, I'd just like it to be consistent.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that the main Dockerfile is quite outdated.

I merged #1902 and I agree, let's get rid of it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

krobelus pushed a commit that referenced this pull request Feb 3, 2026
This matches what we're already using, except for a few inconsistencies.

Part of #12408
krobelus pushed a commit that referenced this pull request Feb 3, 2026
Replace mixed indentation in GNUmakefile used for alignment by a single
tab increase in indentation

Part of #12408
krobelus pushed a commit that referenced this pull request Feb 3, 2026
This is done in accordance with our editorconfig file.

Part of #12408
krobelus pushed a commit that referenced this pull request Feb 3, 2026
krobelus pushed a commit that referenced this pull request Feb 3, 2026
The file we have whose names end in `.in` are not Makefiles, so there is
no reason to deviate from our default formatting for them.

Part of #12408
krobelus pushed a commit that referenced this pull request Feb 3, 2026
krobelus pushed a commit that referenced this pull request Feb 3, 2026
This matches the existing formatting of the files.

Part of #12408
Change some files which have lines whose indentation is not a multiple
of the 4 spaces specified in the editorconfig file.

Some of these changes are fixes or clear improvements (e.g. in Rust
macros which rustfmt can't format properly). Other changes don't clearly
improve the code style, and in some cases it might actually get worse.

The goal is to eventually be able to use our editorconfig for automated
style checks, but there are a lot of cases where conforming to the
limited editorconfig style spec does not make sense, so I'm not sure how
useful such automated checks can be.
@zanchey zanchey added the cleanup label Feb 8, 2026
@zanchey zanchey modified the milestones: fish 4.4, fish-future Feb 8, 2026
danielrainer pushed a commit to danielrainer/fish-shell that referenced this pull request Feb 8, 2026
This Dockerfile has been broken for quite a while now, at least since
Rust is required for building fish. No one seems to have complained
about it being broken, so there is no point in keeping it around. The
`docker` directory contains several Dockerfiles which could be used
instead.

fish-shell#12408 (comment)
krobelus pushed a commit that referenced this pull request Feb 9, 2026
This Dockerfile has been broken for quite a while now, at least since
Rust is required for building fish. No one seems to have complained
about it being broken, so there is no point in keeping it around. The
`docker` directory contains several Dockerfiles which could be used
instead.

#12408 (comment)

Closes #12435
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants