Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c804b60
Ignore EditorConfig violations in external repos
BaumiCoder Jun 27, 2026
bf8df6c
Ignore EditorConfig violations in binary files
BaumiCoder Jun 27, 2026
c1c9357
Handle indentation in Markdown files
BaumiCoder Jun 27, 2026
e1aba58
Handle charset and end_of_line in test files
BaumiCoder Jun 27, 2026
36ec0a8
Align EditorConfig lock formats
BaumiCoder Jun 27, 2026
88885b7
Unset EditorConfig for license texts
BaumiCoder Jun 27, 2026
9afa92f
Fix EditorConfig Violations in rust-installer
BaumiCoder Jun 27, 2026
abe991c
Ignore EditorConfig violations in auxv
BaumiCoder Jun 27, 2026
531e7e0
Address EditorConfig violations in natvis files
BaumiCoder Jun 27, 2026
17d5b84
Harmonize EditorConfig for YAML files
BaumiCoder Jun 27, 2026
ce20a9d
Fix EditorConfig for JSON and JSON5
BaumiCoder Jun 27, 2026
fae5a69
Fix EditorConfig violations in XML files
BaumiCoder Jun 27, 2026
e4ae2be
Add license information for .ecformat_ignore
BaumiCoder Jun 28, 2026
8605f46
Address trailing whitespace characters
BaumiCoder Jun 28, 2026
9bc7837
Fix EditorConfig violations in Dockerfile
BaumiCoder Jun 28, 2026
f461a04
Ignore EditorConfig violations with mixed format
BaumiCoder Jun 28, 2026
9def9bf
Harmonize indentations in Cargo.toml files
BaumiCoder Jun 28, 2026
01442a2
Ignore EditorConfig violations in C and C++ code
BaumiCoder Jun 28, 2026
2d20dfb
Fix EditorConfig for nix files
BaumiCoder Jun 28, 2026
96a128c
Harmonize indentations in shell scripts
BaumiCoder Jun 28, 2026
f90897f
Fix EditorConfig für .gitmodules
BaumiCoder Jun 28, 2026
3818858
Fix ./x test
BaumiCoder Jun 28, 2026
3aa31b5
Fix EditorConfig fish shell completions
BaumiCoder Jun 28, 2026
8274359
Insert final newline in check files
BaumiCoder Jun 28, 2026
2cb1ac6
Address missing final newlines
BaumiCoder Jun 28, 2026
f95d472
Address remaining indentation errors
BaumiCoder Jun 28, 2026
69cdd43
Fix handling of final newlines in .args files
BaumiCoder Jun 29, 2026
896ddea
Undo changes on .args files completely
BaumiCoder Jun 29, 2026
b269a27
Adjust the handling for fish completion scripts
BaumiCoder Jun 30, 2026
d2e526e
Fix grammar in comment
BaumiCoder Jul 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions .ecformat_ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Ignore external repositories as checking for EditorConfig violations there
# is their responsibility and out of scope for here. See also:
# https://github.com/rust-lang/rustc-dev-guide/blob/main/src/external-repos.md
# Subtrees
src/tools/clippy
src/tools/miri
library/portable-simd
src/tools/rustfmt
src/tools/rust-analyzer
compiler/rustc_codegen_cranelift
compiler/rustc_codegen_gcc
src/doc/rustc-dev-guide
library/compiler-builtins
library/stdarch
# Submodules
src/doc/nomicon
src/tools/cargo
src/doc/reference
src/doc/book
src/doc/rust-by-example
src/doc/edition-guide
src/llvm-project
src/doc/embedded-book
library/backtrace
src/tools/rustc-perf
src/tools/enzyme
src/gcc

# Ignore binary files
src/etc/installer/gfx/*
*.auxv
*.png
*.ico
*.woff
*.woff2
tests/run-make/checksum-freshness/binary_file
tests/ui/macros/not-utf8.bin

# Some special cases cannot be handled:
# Markdown file (space indentation) with 'make' code (tab indentation)
src/doc/rustc/src/jobserver.md
# Test file with different line endings and indentations
tests/pretty/block-comment-wchar.rs
# Test file for normalize some CRFL line endings to LF
tests/ui/asm/normalize-offsets-for-crlf.s
# Test file with CR in frontmatter
tests/ui/frontmatter/content-cr.rs
# Test file which uses CRLF line endings but only inside strings
tests/ui/lexer/crlf-in-byte-string-literal.rs
# Test files with CR line ending but only in some doc comments
tests/ui/lexer/lex-bare-cr-*
tests/ui/parser/several-carriage-returns-in-doc-comment.rs
# Test file with tab indentation and one CR line ending
tests/ui/parser/bad-char-literals.rs
# Test file with CR line ending inside string
tests/ui/parser/raw/raw-byte-string-literals.rs
tests/ui/parser/trailing-carriage-return-in-string.rs

# File types with a mixed formatting which is perhaps intentional.
# Disabling only check for some properties (like indent_size) is currently not supported.

# There are different languages in these files (for example css and xml in svg files)
*.diff
*.svg
src/ci/docker/host-x86_64/disabled/dist-x86_64-dragonfly/patch-toolchain
# Often mixed indentation for example due to alignment with previous line
*.c
*.coverage
*.cpp
*.css
*.err
*.fixed
*.goml
*.h
*.js
*.ld
*.py
*.rs
*.stderr
*.stdout
*.ts
*.wxs
tests/run-make/linker-warning/*.txt
tests/run-make/macos-deployment-target-warning/*.txt
library/std/src/sys/pal/sgx/abi/entry.S
tests/pretty/block-comment-wchar.pp
tests/run-make-cargo/thumb-none-qemu/example/memory.x
src/bootstrap/mk/Makefile.in

@BaumiCoder BaumiCoder Jun 29, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This Makefile uses two styles of indentation. First, for targets of a Makefile you need to use tab characters for indentation. Otherwise, it is syntactically wrong. Second, there is some further code at the beginning of this file and there 2 spaces are in use for indentation. I do not know if using only tab character for indentation would be fine for this file or not.

View changes since the review

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is that "according to POSIX" or "according to what is accepted by GNU Make"? Are you quite sure we are otherwise compatible with versions of make that are not GNU Make and that this is the only thing holding us back?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The targets in a Makefile need to use tab characters for indentation according to POSIX (see section "Target rules" here) and GNU Make (see here). In this file all targets are with tab characters. The code which uses spaces for indentation is no target:

ifdef MAKEFLAGS
ifneq (,$(findstring -j, $(MAKEFLAGS)))
BOOTSTRAP_ARGS += $(filter -j%, $(MAKEFLAGS))
endif
endif

I do not know if the spaces there are correct or even necessary with respect to POSIX or GNU Make.

src/etc/rust_analyzer_eglot.el
src/librustdoc/html/static/fonts/README.txt

@BaumiCoder BaumiCoder Jun 29, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The content of this README looks almost like Markdown. Only some formatting bugs may need to be fixed. Should that be changed to a Markdown file? If the content and file ending would be changed, it would not be necessary to ignore it here.

View changes since the review

# The first { in these files is always indented with one space
*.mir
# Alignment and some test files without final newline
*.html
*.html.template
# Shell scripts with the content of patches inlines
src/ci/docker/scripts/musl.sh
src/ci/docker/scripts/solaris-toolchain.sh
# Shell scripts with alignments with previous line
src/ci/docker/host-x86_64/disabled/dist-x86_64-haiku/llvm-config.sh
src/etc/pre-push.sh

# The clap_complete output uses tabs but there is a fix for the next version:
# https://github.com/clap-rs/clap/pull/6422
# When src/bootstrap/Cargo.toml is using a clap_complete version with that fix,
# this ignore can be removed.
src/etc/completions/*.fish
51 changes: 48 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,26 @@ trim_trailing_whitespace = false
[tests/**.{rs,js}]
trim_trailing_whitespace = true
# these specific source files need to have trailing whitespace.
[tests/ui/{frontmatter/frontmatter-whitespace-3.rs,parser/shebang/shebang-space.rs}]
[tests/ui/{frontmatter/{fence-whitespace-trailing-1.rs,frontmatter-whitespace-3.rs},parser/shebang/shebang-space.rs}]
trim_trailing_whitespace = false
# these specific files have a UTF-8 BOM to test with that charset
[tests/ui/codemap_tests/utf8-bom.rs]
charset = utf-8-bom
# these specific files have CRLF line endings to test on them
[tests/{rustdoc-ui/intra-doc/warning-crlf.rs,ui/{frontmatter/frontmatter-crlf.rs,lexer/lexer-crlf-*.rs}}]
end_of_line = crlf
# these specific files have an UTF-8 BOM and CRLF line endings to test on these
[tests/ui/{include-macros/data.bin,json/json-bom-plus-crlf*.rs}]
charset = utf-8-bom
end_of_line = crlf
# these specific files have no trailing newline to test on these
[tests/ui/{lint/unused_parens_multibyte_recovery.rs,parser/{macro/macro-missing-right-paren.rs,missing_right_paren.rs}}]
insert_final_newline = false
[tests/{pretty/issue-74745.rs,ui/{parser/issues/issue-{62524,68730,58094-missing-right-square-bracket}.rs,type/issue-91268.rs}}]

@BaumiCoder BaumiCoder Jun 29, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

These files all have the name pattern issue-*.rs. Using the pattern would reduce the maintenance effort, if new such files without final newlines gets added to the project. However, not all files with that pattern are without a final newline.

View changes since the review

insert_final_newline = false
# Most args files have to be without final newline, otherwise tests in aarch64-gnu-llvm-21-1 fail
[tests/**.args]
insert_final_newline = false

[src/llvm-project]
indent_style = unset
Expand All @@ -36,9 +54,36 @@ max_line_length = 100
# double whitespace at end of line
# denotes a line break in Markdown
trim_trailing_whitespace = false
# Markdown has heavily context specific indentations.
# For example, the indentation in lists depend on the length of the list marker
# (such as '- ' or '100. '), at least in the GitHub Markdown flavor:
# https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#nested-lists
# Therefore, pressing tab should insert a single space to encourage situative accurate indentations.

@BaumiCoder BaumiCoder Jun 29, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It is maybe a matter of taste if inserting only one space with a tab is a nice solution for this or not. Another one would be to keep the default indent_size = 4 for Markdown files and ignore them when checking for EditorConfig violations.

View changes since the review

indent_size = 1

[*.yml]
[*.{json,json5,yml,yaml,askama,ll,natvis,nix}]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we were to add such an indentation rule, I do not think it should group all these unrelated kinds of files such that they would all get changed together. This opinion generalizes across other changes this PR makes, as it enthusiastically uses expansion rules in ways that don't necessarily align with natural groupings.

indent_size = 2

[Makefile]
[{src/doc/full-toc.inc,src/etc/xhelp,src/tools/nix-dev-shell/envrc-flake}]
indent_size = 2

# You should NOT modify these files with your editor,
# but if you do it anyway use the correct formatting.
[Cargo.lock]
indent_size = 1
[yarn.lock]
indent_size = 2
Comment on lines +70 to +75

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I do not believe this indentation is a stable detail that is mandated as part of the format of these lockfiles, so no, I do not think there should be an admonishment to "use the correct formatting" as it can become incorrect with a small diff to Cargo or Yarn and there is no real reason to prevent such.


[{Makefile,Makefile.in,.gitmodules}]
indent_style = tab

# The license texts should NEVER be modified.
# Therefore disable everything to avoid accidental changes on save.
[**{LICENSE,COPY{ING,RIGHT}}**]
charset = unset
indent_style = unset
indent_size = unset
tab_width = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
spelling_language = unset
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/diagnostics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ body:
label: Anything else?
description: If you have more details you want to give us to reproduce this issue, please add it here
validations:
required: false
required: false
102 changes: 51 additions & 51 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,61 @@
resolver = "2"
members = [
# tidy-alphabetical-start
"compiler/rustc",
"src/build_helper",
"src/rustc-std-workspace/rustc-std-workspace-alloc",
"src/rustc-std-workspace/rustc-std-workspace-core",
"src/rustc-std-workspace/rustc-std-workspace-std",
"src/rustdoc-json-types",
"src/tools/build-manifest",
"src/tools/bump-stage0",
"src/tools/cargotest",
"src/tools/clippy",
"src/tools/clippy/clippy_dev",
"src/tools/collect-license-metadata",
"src/tools/compiletest",
"src/tools/coverage-dump",
"src/tools/features-status-dump",
"src/tools/generate-copyright",
"src/tools/generate-windows-sys",
"src/tools/html-checker",
"src/tools/jsondocck",
"src/tools/jsondoclint",
"src/tools/linkchecker",
"src/tools/lint-docs",
"src/tools/lld-wrapper",
"src/tools/llvm-bitcode-linker",
"src/tools/miri",
"src/tools/miri/cargo-miri",
"src/tools/miropt-test-tools",
"src/tools/opt-dist",
"src/tools/remote-test-client",
"src/tools/remote-test-server",
"src/tools/replace-version-placeholder",
"src/tools/run-make-support",
"src/tools/rust-installer",
"src/tools/rustdoc",
"src/tools/rustdoc-gui-test",
"src/tools/rustdoc-themes",
"src/tools/rustfmt",
"src/tools/test-float-parse",
"src/tools/tidy",
"src/tools/tier-check",
"src/tools/unicode-table-generator",
"src/tools/unstable-book-gen",
"src/tools/wasm-component-ld",
"src/tools/x",
"compiler/rustc",
"src/build_helper",
"src/rustc-std-workspace/rustc-std-workspace-alloc",
"src/rustc-std-workspace/rustc-std-workspace-core",
"src/rustc-std-workspace/rustc-std-workspace-std",
"src/rustdoc-json-types",
"src/tools/build-manifest",
"src/tools/bump-stage0",
"src/tools/cargotest",
"src/tools/clippy",
"src/tools/clippy/clippy_dev",
"src/tools/collect-license-metadata",
"src/tools/compiletest",
"src/tools/coverage-dump",
"src/tools/features-status-dump",
"src/tools/generate-copyright",
"src/tools/generate-windows-sys",
"src/tools/html-checker",
"src/tools/jsondocck",
"src/tools/jsondoclint",
"src/tools/linkchecker",
"src/tools/lint-docs",
"src/tools/lld-wrapper",
"src/tools/llvm-bitcode-linker",
"src/tools/miri",
"src/tools/miri/cargo-miri",
"src/tools/miropt-test-tools",
"src/tools/opt-dist",
"src/tools/remote-test-client",
"src/tools/remote-test-server",
"src/tools/replace-version-placeholder",
"src/tools/run-make-support",
"src/tools/rust-installer",
"src/tools/rustdoc",
"src/tools/rustdoc-gui-test",
"src/tools/rustdoc-themes",
"src/tools/rustfmt",
"src/tools/test-float-parse",
"src/tools/tidy",
"src/tools/tier-check",
"src/tools/unicode-table-generator",
"src/tools/unstable-book-gen",
"src/tools/wasm-component-ld",
"src/tools/x",
# tidy-alphabetical-end
]

exclude = [
"build",
"compiler/rustc_codegen_cranelift",
"compiler/rustc_codegen_gcc",
"src/bootstrap",
"tests/rustdoc-gui",
# HACK(eddyb) This hardcodes the fact that our CI uses `/checkout/obj`.
"obj",
"build",
"compiler/rustc_codegen_cranelift",
"compiler/rustc_codegen_gcc",
"src/bootstrap",
"tests/rustdoc-gui",
# HACK(eddyb) This hardcodes the fact that our CI uses `/checkout/obj`.
"obj",
]

[profile.release.package.rustc_thread_pool]
Expand Down
1 change: 1 addition & 0 deletions REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ path = [
"x.ps1",
"x.py",
".clang-format",
".ecformat_ignore",
".editorconfig",
".git-blame-ignore-revs",
".gitattributes",
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc/Windows Manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ See: https://docs.microsoft.com/en-us/windows/win32/sbscs/application-manifests
-->
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<!-- Versions rustc supports as compiler hosts -->
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 7 --><supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows 8 --><supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 8.1 --><supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 10 and 11 --><supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</application>
</compatibility>
<!-- Use UTF-8 code page -->
<asmv3:application>
Expand Down
14 changes: 7 additions & 7 deletions library/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ cargo-features = ["profile-rustflags"]
[workspace]
resolver = "1"
members = [
"std",
"sysroot",
"coretests",
"alloctests",
"std",
"sysroot",
"coretests",
"alloctests",
]

exclude = [
# stdarch has its own Cargo workspace
"stdarch",
"windows_link"
# stdarch has its own Cargo workspace
"stdarch",
"windows_link"
]

[profile.release.package.compiler_builtins]
Expand Down
2 changes: 1 addition & 1 deletion library/rustc-std-workspace-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ doc = false
[dependencies]
core = { path = "../core", public = true }
compiler_builtins = { path = "../compiler-builtins/compiler-builtins", features = [
"compiler-builtins",
"compiler-builtins",
] }
2 changes: 1 addition & 1 deletion library/std/src/sys/pal/sgx/abi/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ elf_entry:
sub %rax,%rdx /* all chars written? */
jnz .Lelf_entry_call

.Lelf_exit:
.Lelf_exit:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please do not change so much as a single character of an assembly file if there is no technical need and you are not willing to verify the SGX assembly still works as-intended on the platform it is used on, which is not something our test suite covers.

movq $60,%rax /* exit() syscall */
movq $1,%rdi /* exit code 1 */
syscall
Expand Down
2 changes: 1 addition & 1 deletion library/unwind/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/rust.git"
edition = "2024"
include = [
'/libunwind/*',
'/libunwind/*',
]

[lib]
Expand Down
Loading