Skip to content

Commit

Permalink
refactor(lint): use a shared lint config for the workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Jan 24, 2025
1 parent 8178c9b commit bfc1d4f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 24 deletions.
26 changes: 2 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,34 +93,12 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: clippy
args: >
--tests --verbose --
-D warnings
-A clippy::literal_string_with_formatting_args
-A clippy::tabs_in_doc_comments
args: --tests --verbose -- -D warnings
- name: Check the pedantic lints
uses: actions-rs/cargo@v1
with:
command: clippy
args: >
--all-targets --verbose -- -W clippy::pedantic
-A clippy::needless_raw_string_hashes
-A clippy::unreadable_literal
-A clippy::redundant_else
-A clippy::items_after_statements
-A clippy::missing_errors_doc
-A clippy::module_name_repetitions
-A clippy::uninlined_format_args
-A clippy::manual_string_new
-A clippy::must_use_candidate
-A clippy::too_many_lines
-A clippy::wildcard_imports
-A clippy::missing_panics_doc
-A clippy::inefficient_to_string
-A clippy::redundant_closure_for_method_calls
-A clippy::map_unwrap_or
-A clippy::struct_excessive_bools
-A clippy::unnecessary_wraps
args: --all-targets --verbose -- -W clippy::pedantic

rustfmt:
name: Formatting
Expand Down
21 changes: 21 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,24 @@ strip = true
opt-level = 3
debug = true # used by the profiler
strip = false # keep symbols for the profiler

[workspace.lints.clippy]
literal_string_with_formatting_args = "allow"
tabs_in_doc_comments = "allow"
needless_raw_string_hashes = "allow"
unreadable_literal = "allow"
redundant_else = "allow"
items_after_statements = "allow"
missing_errors_doc = "allow"
module_name_repetitions = "allow"
uninlined_format_args = "allow"
manual_string_new = "allow"
must_use_candidate = "allow"
too_many_lines = "allow"
wildcard_imports = "allow"
missing_panics_doc = "allow"
inefficient_to_string = "allow"
redundant_closure_for_method_calls = "allow"
map_unwrap_or = "allow"
struct_excessive_bools = "allow"
unnecessary_wraps = "allow"
3 changes: 3 additions & 0 deletions git-cliff-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,6 @@ temp-dir = "0.1.14"
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lints]
workspace = true
3 changes: 3 additions & 0 deletions git-cliff/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ path = "../git-cliff-core"
[dev-dependencies]
pretty_assertions = "1.4.1"

[lints]
workspace = true

# metadata for cargo-binstall to get the right artifacts
[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ version }-{ target }{ archive-suffix }"
Expand Down

0 comments on commit bfc1d4f

Please sign in to comment.