diff --git a/Makefile b/Makefile index faae956..50962d6 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,38 @@ -.PHONY: render +# Dynamic Analysis Tools Repository Makefile + +.PHONY: render render-skip-deprecated check clippy fmt test clean help + +# Default target shows help +help: + @echo "Available targets:" + @echo " render - Render README.md and JSON API from YAML sources" + @echo " render-skip-deprecated - Render without deprecated tools" + @echo " check - Run cargo check" + @echo " clippy - Run clippy lints" + @echo " fmt - Format Rust code" + @echo " test - Run tests" + @echo " clean - Clean build artifacts" + @echo " help - Show this help" + +# Main rendering targets render: cargo run --manifest-path data/render/Cargo.toml -- --tags data/tags.yml --tools data/tools --md-out README.md --json-out data/api -.PHONY: render-skip-deprecated render-skip-deprecated: - cargo run --manifest-path data/render/Cargo.toml -- --tags data/tags.yml --tools data/tools --md-out README.md --json-out data/api --skip-deprecated \ No newline at end of file + cargo run --manifest-path data/render/Cargo.toml -- --tags data/tags.yml --tools data/tools --md-out README.md --json-out data/api --skip-deprecated + +# Development targets +check: + cargo check --manifest-path data/render/Cargo.toml + +clippy: + cargo clippy --manifest-path data/render/Cargo.toml -- -D warnings + +fmt: + cargo fmt --manifest-path data/render/Cargo.toml + +test: + cargo test --manifest-path data/render/Cargo.toml + +clean: + cargo clean --manifest-path data/render/Cargo.toml \ No newline at end of file diff --git a/data/render/clippy.toml b/data/render/clippy.toml new file mode 100644 index 0000000..bab7994 --- /dev/null +++ b/data/render/clippy.toml @@ -0,0 +1,14 @@ +# Clippy configuration for stricter linting +# https://rust-lang.github.io/rust-clippy/master/index.html + +# Set the threshold for too many arguments +too-many-arguments-threshold = 4 + +# Set the threshold for too many lines +too-many-lines-threshold = 100 + +# Set the threshold for type complexity +type-complexity-threshold = 250 + +# Avoid suggesting wildcard imports +avoid-breaking-exported-api = false \ No newline at end of file diff --git a/data/render/src/lib.rs b/data/render/src/lib.rs index 9aaa9c6..95930f0 100644 --- a/data/render/src/lib.rs +++ b/data/render/src/lib.rs @@ -51,8 +51,8 @@ pub async fn check_deprecated(token: String, entries: &mut Vec) -> Result if let Ok(commit_list) = github.repo(owner, repo).commits().list("").await { let date = &commit_list[0].commit.author.date; let last_commit = NaiveDateTime::parse_from_str(date, "%Y-%m-%dT%H:%M:%SZ")?; - let last_commit_utc = DateTime::::from_utc(last_commit, Utc); - let duration = Local::today().signed_duration_since(last_commit_utc.date()); + let last_commit_utc: DateTime = DateTime::from_naive_utc_and_offset(last_commit, Utc); + let duration = Local::now().date_naive().signed_duration_since(last_commit_utc.date_naive()); if duration.num_days() > 365 { entry.deprecated = Some(true);