Conversation
.editorconfig
Outdated
| max_line_length = 72 | ||
|
|
||
| [Dockerfile] | ||
| [{Dockerfile,Vagrantfile}] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
It seems that the main Dockerfile is quite outdated.
I merged #1902 and I agree, let's get rid of it
This matches what we're already using, except for a few inconsistencies. Part of #12408
Replace mixed indentation in GNUmakefile used for alignment by a single tab increase in indentation Part of #12408
This is done in accordance with our editorconfig file. Part of #12408
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
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.
edf977f to
9e1eb7d
Compare
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)
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
Work towards more consistent formatting and consistency between what's specified in
.editorconfigand how the files are actually formatted.The commits in this PR are fairly independent and can mostly be merged individually.