Skip to content

Commit

Permalink
Merge pull request #52 from danielparks/native-lints
Browse files Browse the repository at this point in the history
Use `[lints]` table in Cargo.toml instead of lints.toml.
  • Loading branch information
danielparks authored Feb 12, 2024
2 parents 817b405 + 79a527c commit 1ed8c59
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 55 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/pr-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ jobs:
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
- uses: taiki-e/install-action@v2
with:
tool: cargo-lints
- run: cargo lints clippy --all-features --all-targets
- run: cargo clippy --all-features --all-targets
- name: check doc lints
env:
RUSTDOCFLAGS: --document-private-items -Dwarnings
Expand Down
49 changes: 49 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,52 @@ duct = "0.13.6"
pretty_assertions = "1.3.0"
regex = "1.7.0"
target-test-dir = "0.3.0"

[lints]
workspace = true

[workspace.lints.rust]
unsafe_code = "forbid"
missing_docs = "warn"

[workspace.lints.clippy]
nursery = "warn"
pedantic = "warn"
missing_docs_in_private_items = "warn"

# Other restriction lints
arithmetic_side_effects = "warn"
as_underscore = "warn"
assertions_on_result_states = "warn"
dbg_macro = "warn"
default_union_representation = "warn"
empty_structs_with_brackets = "warn"
filetype_is_file = "warn" # maybe?
fn_to_numeric_cast_any = "warn"
format_push_string = "warn" # maybe? alternative is fallible.
get_unwrap = "warn"
impl_trait_in_params = "warn"
integer_division = "warn"
lossy_float_literal = "warn"
mem_forget = "warn"
mixed_read_write_in_expression = "warn"
multiple_inherent_impl = "warn"
multiple_unsafe_ops_per_block = "warn"
mutex_atomic = "warn"
rc_buffer = "warn"
rc_mutex = "warn"
same_name_method = "warn"
semicolon_inside_block = "warn"
str_to_string = "warn"
string_to_string = "warn"
undocumented_unsafe_blocks = "warn"
unnecessary_safety_doc = "warn"
unnecessary_self_imports = "warn"
unneeded_field_pattern = "warn"
verbose_file_reads = "warn"

# Pedantic exceptions
let_underscore_untyped = "allow"
manual_string_new = "allow"
map_unwrap_or = "allow"
module_name_repetitions = "allow"
51 changes: 0 additions & 51 deletions lints.toml

This file was deleted.

0 comments on commit 1ed8c59

Please sign in to comment.