-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add custom configuration for clippy and rustfmt
- Loading branch information
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Clippy configuration | ||
# https://doc.rust-lang.org/nightly/clippy/lint_configuration.html | ||
|
||
allow-private-module-inception = true | ||
avoid-breaking-exported-api = false | ||
disallowed-names = [] | ||
disallowed-macros = [ | ||
{ path = "std::dbg", reason = "it is okay to use during development, but please do not include it in main branch" }, | ||
{ path = "std::println", reason = "it is okay to use during development, but please do not include it in main branch, use tracing & log" }, | ||
{ path = "std::eprintln", reason = "it is okay to use during development, but please do not include it in main branch, use tracing & log" }, | ||
] | ||
disallowed-methods = [] | ||
disallowed-types = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Rustfmt configuration | ||
# https://github.com/rust-lang/rustfmt/blob/HEAD/Configurations.md | ||
|
||
# Rustfmt cannot format long lines inside macros, but this option detects this. | ||
# This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/3391) | ||
error_on_line_overflow = true | ||
|
||
# Override the default formatting style. | ||
# See https://internals.rust-lang.org/t/running-rustfmt-on-rust-lang-rust-and-other-rust-lang-repositories/8732/81. | ||
use_small_heuristics = "Max" | ||
# This is the default of 2024 edition https://github.com/rust-lang/rust/pull/114764. | ||
# This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/3370) | ||
overflow_delimited_expr = true | ||
# This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/4991). | ||
imports_granularity = "Crate" | ||
# This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/5083). | ||
group_imports = "StdExternalCrate" | ||
|
||
# Apply rustfmt to more places. | ||
# This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/3348). | ||
format_code_in_doc_comments = true | ||
|
||
# Automatically fix deprecated style. | ||
use_field_init_shorthand = true | ||
use_try_shorthand = true | ||
|
||
# Set the default settings again to always apply the proper formatting without | ||
# being affected by the editor settings. | ||
edition = "2021" | ||
hard_tabs = false | ||
newline_style = "Unix" | ||
tab_spaces = 4 |