Skip to content

Commit

Permalink
build: improve devcontainer setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Wodann committed Feb 9, 2025
1 parent 8482286 commit 820ac4c
Show file tree
Hide file tree
Showing 37 changed files with 179 additions and 91 deletions.
79 changes: 0 additions & 79 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,82 +3,3 @@
gen-syntax = "run --package tools --bin tools -- gen-syntax"
gen-runtime-capi = "run --package tools --bin tools -- gen-runtime-capi"
gen-abi = "run --package tools --bin tools -- gen-abi"

[target.'cfg(all())']
rustflags = [
"-Wclippy::all",
"-Wclippy::await_holding_lock",
"-Wclippy::bool-to-int-with-if",
"-Wclippy::cast_lossless",
"-Wclippy::char_lit_as_u8",
"-Wclippy::checked_conversions",
"-Wclippy::debug_assert_with_mut_call",
"-Wclippy::default_trait_access",
"-Wclippy::doc_markdown",
"-Wclippy::empty_enum",
"-Wclippy::enum_glob_use",
"-Wclippy::expl_impl_clone_on_copy",
"-Wclippy::explicit_deref_methods",
"-Wclippy::explicit_into_iter_loop",
"-Wclippy::fallible_impl_from",
"-Wclippy::filter_map_next",
"-Wclippy::flat_map_option",
"-Wclippy::float_cmp_const",
"-Wclippy::fn_params_excessive_bools",
"-Wclippy::from_iter_instead_of_collect",
"-Wclippy::if-not-else",
"-Wclippy::implicit_clone",
"-Wclippy::imprecise_flops",
"-Wclippy::inconsistent_struct_constructor",
"-Wclippy::inefficient_to_string",
"-Wclippy::invalid_upcast_comparisons",
"-Wclippy::items-after-statements",
"-Wclippy::large_digit_groups",
"-Wclippy::large_stack_arrays",
"-Wclippy::large_types_passed_by_value",
"-Wclippy::let_unit_value",
"-Wclippy::linkedlist",
"-Wclippy::lossy_float_literal",
"-Wclippy::macro_use_imports",
"-Wclippy::manual-assert",
"-Wclippy::manual_ok_or",
"-Wclippy::map_err_ignore",
"-Wclippy::map_flatten",
"-Wclippy::map_unwrap_or",
"-Wclippy::match_on_vec_items",
"-Wclippy::match_same_arms",
"-Wclippy::match_wild_err_arm",
"-Wclippy::match_wildcard_for_single_variants",
"-Wclippy::mem_forget",
"-Wclippy::missing_enforced_import_renames",
"-Wclippy::mut_mut",
"-Wclippy::mutex_integer",
"-Wclippy::needless_borrow",
"-Wclippy::needless_continue",
"-Wclippy::needless_for_each",
"-Wclippy::option_option",
"-Wclippy::path_buf_push_overwrite",
"-Wclippy::ptr_as_ptr",
"-Wclippy::rc_mutex",
"-Wclippy::redundant_closure_for_method_calls",
"-Wclippy::ref_option_ref",
"-Wclippy::rest_pat_in_fully_bound_structs",
"-Wclippy::same_functions_in_if_condition",
"-Wclippy::semicolon_if_nothing_returned",
"-Wclippy::single_match_else",
"-Wclippy::string_add_assign",
"-Wclippy::string_lit_as_bytes",
"-Wclippy::string_to_string",
"-Wclippy::todo",
"-Wclippy::trait_duplication_in_bounds",
"-Wclippy::uninlined_format_args",
"-Wclippy::unnested_or_patterns",
"-Wclippy::unused_self",
"-Wclippy::useless_transmute",
"-Wclippy::verbose_file_reads",
"-Wclippy::wildcard-imports",
"-Wclippy::zero_sized_map_values",
"-Wfuture_incompatible",
"-Wnonstandard_style",
"-Wrust_2018_idioms",
]
5 changes: 1 addition & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
"onAutoForward": "openPreview"
}
},
// Every time the container is started, update Rust to the version specified in the `rust-toolchain` file.
"postStartCommand": "scripts/setup.sh",
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "rustc --version",
"postCreateCommand": "scripts/setup.sh",
// Configure tool-specific properties.
"customizations": {
"vscode": {
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:
- release/*

env:
RUSTFLAGS: -Dwarnings
CARGO_TERM_COLOR: always

concurrency:
Expand Down Expand Up @@ -325,4 +324,4 @@ jobs:
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
args: --all --all-features --all-targets -- -D warnings
80 changes: 80 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,86 @@ yansi-term = { version = "0.1.2", default-features = false }
notify = { version = "5.2.0" }
winapi = { version = "0.3.9", default-features = false }

[workspace.lints.clippy]
all = "warn"
await_holding_lock = "warn"
bool-to-int-with-if = "warn"
cast_lossless = "warn"
char_lit_as_u8 = "warn"
checked_conversions = "warn"
debug_assert_with_mut_call = "warn"
default_trait_access = "warn"
doc_markdown = "warn"
empty_enum = "warn"
enum_glob_use = "warn"
expl_impl_clone_on_copy = "warn"
explicit_deref_methods = "warn"
explicit_into_iter_loop = "warn"
fallible_impl_from = "warn"
filter_map_next = "warn"
flat_map_option = "warn"
float_cmp_const = "warn"
fn_params_excessive_bools = "warn"
from_iter_instead_of_collect = "warn"
if-not-else = "warn"
implicit_clone = "warn"
imprecise_flops = "warn"
inconsistent_struct_constructor = "warn"
inefficient_to_string = "warn"
invalid_upcast_comparisons = "warn"
items-after-statements = "warn"
large_digit_groups = "warn"
large_stack_arrays = "warn"
large_types_passed_by_value = "warn"
let_unit_value = "warn"
linkedlist = "warn"
lossy_float_literal = "warn"
macro_use_imports = "warn"
manual-assert = "warn"
manual_ok_or = "warn"
map_err_ignore = "warn"
map_flatten = "warn"
map_unwrap_or = "warn"
match_on_vec_items = "warn"
match_same_arms = "warn"
match_wild_err_arm = "warn"
match_wildcard_for_single_variants = "warn"
mem_forget = "warn"
missing_enforced_import_renames = "warn"
mut_mut = "warn"
mutex_integer = "warn"
needless_borrow = "warn"
needless_continue = "warn"
needless_for_each = "warn"
option_option = "warn"
path_buf_push_overwrite = "warn"
ptr_as_ptr = "warn"
rc_mutex = "warn"
redundant_closure_for_method_calls = "warn"
ref_option_ref = "warn"
rest_pat_in_fully_bound_structs = "warn"
same_functions_in_if_condition = "warn"
semicolon_if_nothing_returned = "warn"
single_match_else = "warn"
string_add_assign = "warn"
string_lit_as_bytes = "warn"
string_to_string = "warn"
todo = "warn"
trait_duplication_in_bounds = "warn"
uninlined_format_args = "warn"
unnested_or_patterns = "warn"
unused_self = "warn"
useless_transmute = "warn"
verbose_file_reads = "warn"
wildcard-imports = "warn"
zero_sized_map_values = "warn"

[workspace.lints.rust]
future_incompatible = "warn"
nonstandard_style = "warn"
rust_2018_idioms = "warn"
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin_include)'] }

[profile.dev]
rpath = true

Expand Down
3 changes: 3 additions & 0 deletions crates/mun/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ mun_skeptic = { path = "../mun_skeptic", version = "0.6.0-dev" }

[build-dependencies]
mun_skeptic = { path = "../mun_skeptic", version = "0.6.0-dev" }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/mun_abi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ itertools = { workspace = true }
parking_lot = { workspace = true }
extendhash = { workspace = true }
serde = { workspace = true, optional = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/mun_capi_utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ license.workspace = true

[dependencies]
insta = { workspace = true, features = ["ron"], optional = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/mun_codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ insta = { workspace = true, features = ["ron"] }
mun_libloader = { path = "../mun_libloader" }
mun_test = { path = "../mun_test" }
mun_runtime = { path = "../mun_runtime" }

[lints]
workspace = true
5 changes: 3 additions & 2 deletions crates/mun_codegen_macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ proc-macro2 = { workspace = true }
quote = { workspace = true }
syn = { workspace = true, features = ["derive", "parsing", "printing", "proc-macro"] }

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin_include)'] }
[lints]
workspace = true

3 changes: 3 additions & 0 deletions crates/mun_compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ yansi-term = { workspace = true }

[dev-dependencies]
insta = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/mun_compiler_daemon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ notify = { version = "4.0", default-features = false }
# Enable std feature for winapi through feature unification to ensure notify uses the correct `c_void` type
[target.'cfg(windows)'.dependencies]
winapi = { workspace = true, features = ["std"] }

[lints]
workspace = true
3 changes: 2 additions & 1 deletion crates/mun_db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ repository.workspace = true
license.workspace = true
categories.workspace = true

[dependencies]
[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/mun_diagnostics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ license.workspace = true
[dependencies]
mun_hir = { version = "0.6.0-dev", path = "../mun_hir" }
mun_syntax = { version = "0.6.0-dev", path = "../mun_syntax" }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/mun_hir/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ mun_test = { path = "../mun_test" }
insta = { workspace = true }
parking_lot = { workspace = true }
text_trees = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/mun_hir_input/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ salsa = { workspace = true }

[dev-dependencies]
insta = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/mun_language_server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ insta = { workspace = true }
itertools = { workspace = true }
tempdir = { workspace = true }
text_trees = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/mun_libloader/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ anyhow = { workspace = true, features = ["std"] }
libloading = { workspace = true }
tempfile = { workspace = true }
thiserror = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/mun_memory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ thiserror = { workspace = true }
mun_capi_utils = { version = "0.6.0-dev", path = "../mun_capi_utils", features = ["insta"] }
insta = { workspace = true, features = ["ron"] }
paste = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/mun_paths/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ license.workspace = true

[dependencies]
relative-path = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/mun_project/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ semver = { workspace = true, features = ["serde"] }
serde = { workspace = true }
serde_derive = { workspace = true }
toml = { workspace = true, features = ["parse"] }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/mun_runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ mun_compiler = { path = "../mun_compiler" }
mun_test = { path = "../mun_test" }
tempfile = { workspace = true }
termcolor = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/mun_runtime_capi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ insta = { workspace = true, features = ["ron"] }
mun_compiler = { path="../mun_compiler" }
paste = { workspace = true }
tempfile = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/mun_skeptic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ pulldown-cmark = { workspace = true }
mun_compiler = { version = "0.6.0-dev", path = "../mun_compiler" }
mun_runtime = { version = "0.6.0-dev", path = "../mun_runtime" }
tempdir = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/mun_syntax/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ unicode-xid = { workspace = true }

[dev-dependencies]
insta = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/mun_target/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ log = { workspace = true }

[dev-dependencies]
insta = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/mun_test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ mun_paths = { version = "0.6.0-dev", path = "../mun_paths" }
anyhow = { workspace = true }
itertools = { workspace = true }
tempfile = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/mun_vfs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ log = { workspace = true }
notify = { workspace = true }
rustc-hash = { workspace = true }
walkdir = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ difference = { workspace = true }
heck = { workspace = true }
ron = { workspace = true }
tera = { workspace = true }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions examples/buoyancy/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ edition = "2021"

[dependencies]
mun_runtime = { path = "../../../crates/mun_runtime" }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions examples/fibonacci/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ edition = "2021"

[dependencies]
mun_runtime = { path = "../../../crates/mun_runtime" }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions examples/rust-bevy-simple/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ edition = "2021"
[dependencies]
mun_runtime = { path = "../../crates/mun_runtime" }
bevy = { version = "0.8", default-features = false }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions examples/rust-pong/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ edition = "2021"
mun_runtime = { path="../../crates/mun_runtime" }
ggez = {version = "0.6" }
rand = "0.8"

[lints]
workspace = true
2 changes: 2 additions & 0 deletions examples/rust-spaceship/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ mun_runtime = { path="../../crates/mun_runtime" }
rand = "0.8"
tetra = { version = "0.7", features=["sdl2_bundled"] }

[lints]
workspace = true
Loading

0 comments on commit 820ac4c

Please sign in to comment.