-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Address EditorConfig violations #158550
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
base: main
Are you sure you want to change the base?
Address EditorConfig violations #158550
Changes from all commits
6985d35
671da61
57b945a
9a092e0
1447b07
d2e89b5
f286e46
d0029c8
0ec17ff
9d66e58
8774270
f01fc32
2945de5
667b0e3
d4b618e
2d0d28b
f337fab
ffcf0ba
928494f
e0a7065
2807830
8530d84
3f0a7e8
010438a
468c817
ae4e459
1fbae84
23f0469
4a53e21
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||
| src/etc/rust_analyzer_eglot.el | ||
| src/librustdoc/html/static/fonts/README.txt | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| # 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 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 an 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 | ||
|
Comment on lines
+27
to
+36
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is now a third location (next to |
||
| # 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}}] | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These files all have the name pattern |
||
| 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 | ||
|
|
@@ -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. | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 = 1 | ||
|
|
||
| [*.yml] | ||
| [*.{json,json5,yml,yaml,askama,ll,natvis,nix}] | ||
| 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 | ||
|
|
||
| [{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 | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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