Skip to content

Commit

Permalink
Add taplo config and pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
uklotzde committed Oct 24, 2024
1 parent a23664e commit f3a7e18
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 31 deletions.
8 changes: 1 addition & 7 deletions .deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@ db-urls = ["https://github.com/rustsec/advisory-db"]
yanked = "deny"

[licenses]
allow = [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MPL-2.0",
"Unicode-DFS-2016",
]
allow = ["Apache-2.0", "BSD-2-Clause", "MIT", "MPL-2.0", "Unicode-DFS-2016"]

[bans]
# Multiple versions of dependencies are inevitable and cannot be avoided.
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ repos:
types_or:
- yaml
- markdown
- repo: https://github.com/ComPWA/taplo-pre-commit
rev: v0.9.3
hooks:
- id: taplo-format
- id: taplo-lint
# https://reuse.software
- repo: https://github.com/fsfe/reuse-tool
rev: v4.0.3
Expand Down
5 changes: 5 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-FileCopyrightText: Copyright (c) 2017-2024 slowtec GmbH <post@slowtec.de>
# SPDX-License-Identifier: CC0-1.0

[formatting]
column_width = 100
30 changes: 7 additions & 23 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
name = "tokio-modbus"
description = "Tokio-based Modbus library"
version = "0.15.0"
authors = [
"slowtec GmbH <post@slowtec.de>",
"Markus Kohlhase <markus.kohlhase@slowtec.de>",
]
authors = ["slowtec GmbH <post@slowtec.de>", "Markus Kohlhase <markus.kohlhase@slowtec.de>"]
license = "MIT OR Apache-2.0"
readme = "README.md"
keywords = ["fieldbus", "modbus", "hardware", "automation"]
Expand Down Expand Up @@ -37,18 +34,16 @@ thiserror = "1.0.58"
tokio = { version = "1.35.1", default-features = false, features = ["io-util"] }
# Disable default-features to exclude unused dependency on libudev
tokio-serial = { version = "5.4.4", optional = true, default-features = false }
tokio-util = { version = "0.7.10", optional = true, default-features = false, features = [
"codec",
] }
tokio-util = { version = "0.7.10", optional = true, default-features = false, features = ["codec"] }

[dev-dependencies]
anyhow = "1.0.86"
env_logger = "0.11.5"
futures = "0.3.30"
tokio = { version = "1.35.1", default-features = false, features = [
"macros",
"rt-multi-thread",
"time",
"macros",
"rt-multi-thread",
"time",
] }
tokio-serial = { version = "5.4.4", default-features = false }
rustls-pemfile = "2.1.2"
Expand All @@ -60,23 +55,12 @@ rustls = { version = "0.23.12", default-features = false, features = ["std"] }

[features]
default = ["rtu", "tcp"]
rtu = [
"dep:futures-core",
"futures-util/sink",
"dep:smallvec",
"dep:tokio-util",
]
rtu = ["dep:futures-core", "futures-util/sink", "dep:smallvec", "dep:tokio-util"]
tcp = ["dep:futures-core", "futures-util/sink", "tokio/net", "dep:tokio-util"]
rtu-sync = ["rtu", "sync", "dep:tokio-serial"]
tcp-sync = ["tcp", "sync"]
rtu-server = ["rtu", "server", "tokio/macros", "dep:tokio-serial"]
tcp-server = [
"tcp",
"server",
"socket2/all",
"tokio/macros",
"tokio/rt-multi-thread",
]
tcp-server = ["tcp", "server", "socket2/all", "tokio/macros", "tokio/rt-multi-thread"]
rtu-over-tcp-server = ["rtu", "tcp-server"]
# The following features are internal and must not be used in dependencies.
sync = ["dep:futures-core", "futures-util/sink", "tokio/time", "tokio/rt"]
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
[toolchain]
channel = "stable"
profile = "minimal"
components = [ "rustfmt", "clippy" ]
components = ["rustfmt", "clippy"]

0 comments on commit f3a7e18

Please sign in to comment.