Fix all clippy warnings and migrate CLI to clap #1

Merged
timur merged 3 commits from clippy-fixes-and-clap into development 2026-02-19 05:41:50 +00:00
Member
  • Fix 40+ clippy warnings across the codebase:

    • collapsible_if: Use if-let chains with && for cleaner nested conditionals
    • manual_strip: Use strip_prefix() instead of starts_with() + slicing
    • io_other_error: Use std::io::Error::other()
    • inherent_to_string: Implement Display trait for FilePermissions
    • unnecessary_lazy_evaluations: Use unwrap_or instead of unwrap_or_else
    • redundant_closure: Use tuple variant directly in map_err
    • type_complexity: Add CheckinRow type alias
    • unnecessary_unwrap: Use pattern matching
    • needless_borrow: Remove unnecessary references
    • while_let_on_iterator: Use for loop
    • redundant_allocation: Fix Arc<Arc<...>> in WebDAV server
    • derivable_impls: Use #[derive(Default)] with #[default] attribute
    • manual_inspect: Use inspect_err instead of map_err
    • ptr_arg: Use &Path instead of &PathBuf in function signatures
  • Migrate CLI argument parsing from hand-rolled to clap:

    • Add clap dependency with derive feature
    • Define Cli struct with proper argument definitions
    • Add Commands enum for start/stop/status subcommands
    • Auto-generated --help and --version
    • Type-safe argument parsing with validation

Passes cargo clippy --all-targets --all-features with zero warnings.

- Fix 40+ clippy warnings across the codebase: - collapsible_if: Use if-let chains with && for cleaner nested conditionals - manual_strip: Use strip_prefix() instead of starts_with() + slicing - io_other_error: Use std::io::Error::other() - inherent_to_string: Implement Display trait for FilePermissions - unnecessary_lazy_evaluations: Use unwrap_or instead of unwrap_or_else - redundant_closure: Use tuple variant directly in map_err - type_complexity: Add CheckinRow type alias - unnecessary_unwrap: Use pattern matching - needless_borrow: Remove unnecessary references - while_let_on_iterator: Use for loop - redundant_allocation: Fix Arc<Arc<...>> in WebDAV server - derivable_impls: Use #[derive(Default)] with #[default] attribute - manual_inspect: Use inspect_err instead of map_err - ptr_arg: Use &Path instead of &PathBuf in function signatures - Migrate CLI argument parsing from hand-rolled to clap: - Add clap dependency with derive feature - Define Cli struct with proper argument definitions - Add Commands enum for start/stop/status subcommands - Auto-generated --help and --version - Type-safe argument parsing with validation Passes cargo clippy --all-targets --all-features with zero warnings.
- Fix 40+ clippy warnings across the codebase:
  - collapsible_if: Use if-let chains with && for cleaner nested conditionals
  - manual_strip: Use strip_prefix() instead of starts_with() + slicing
  - io_other_error: Use std::io::Error::other()
  - inherent_to_string: Implement Display trait for FilePermissions
  - unnecessary_lazy_evaluations: Use unwrap_or instead of unwrap_or_else
  - redundant_closure: Use tuple variant directly in map_err
  - type_complexity: Add CheckinRow type alias
  - unnecessary_unwrap: Use pattern matching
  - needless_borrow: Remove unnecessary references
  - while_let_on_iterator: Use for loop
  - redundant_allocation: Fix Arc<Arc<...>> in WebDAV server
  - derivable_impls: Use #[derive(Default)] with #[default] attribute
  - manual_inspect: Use inspect_err instead of map_err
  - ptr_arg: Use &Path instead of &PathBuf in function signatures

- Migrate CLI argument parsing from hand-rolled to clap:
  - Add clap dependency with derive feature
  - Define Cli struct with proper argument definitions
  - Add Commands enum for start/stop/status subcommands
  - Auto-generated --help and --version
  - Type-safe argument parsing with validation

Passes cargo clippy --all-targets --all-features with zero warnings.
fix: Update git_import_test URL to new hero_lib repo
All checks were successful
Build and Test / build (push) Successful in 4m14s
e2d286f45d
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add build_lib.sh build system with Makefile and CI workflows
Some checks failed
Build and Test / build (push) Failing after 11s
234d58520a
Migrate to standardized build system using build_lib.sh from hero_lib.
Add buildenv.sh project config, rewrite Makefile to source build_lib.sh,
and create Forgejo CI workflows for Linux/macOS builds on tags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix Makefile cargo and shell compatibility
All checks were successful
Build and Test / build (push) Successful in 2m41s
526eab5159
Add SHELL := /bin/bash to use bash instead of sh (enables source command)
Add CARGO_ENV helper to ensure cargo is in PATH before running cargo commands

This fixes exit code 127 errors in CI/CD environments where cargo might not
be in the default PATH.

Applies to all cargo-using targets: build, check, fmt, fmt-check, lint,
run, test, test-all, clean, installdev, deps.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
feat: add context-based WebDAV server support
All checks were successful
Build and Test / build (push) Successful in 4m9s
Build and Test / build (pull_request) Successful in 3m24s
75996e9bec
- Integrate `dav-server` for WebDAV handling
- Add `--webdav-storage` CLI arg to `heroforge-server`
- Serve WebDAV at `/webdav/{context}/` with local storage
- Implement `COPY` method for WebDAV client
- Update help messages and Makefile for WebDAV
Reviewed-on: lhumina_code/hero_forge#6
refactor: streamline build system and code formatting
All checks were successful
Build and Test / build (push) Successful in 3m11s
1ad44e0cc7
- Remove obsolete Makefile targets and variables
- Simplify build, run, test, and clean commands
- Set default `run` target to start WebDAV server
- Reformat WebDAV server Rust code
- Rename internal WebDAV `max_file_size` functions
fix: make RELEASE_DIR respect CARGO_TARGET_DIR
All checks were successful
Build and Test / build (push) Successful in 3m27s
f957dd22e0
When CARGO_TARGET_DIR is set (e.g. by hero_zero), binaries end up
outside target/release. RELEASE_DIR now falls back correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: rename binary to hero_forge, add make install
Some checks are pending
Build and Test / build (push) Waiting to run
ebb82cf6ba
- Rename heroforge-server -> hero_forge (Cargo.toml)
- Update buildenv.sh BINARIES
- Add install target to Makefile (installs to ~/hero/bin/)
- Per naming_convention: binary matches repo name in snake_case
fix: use tmp+mv for binary install to avoid 'Text file busy' error
Some checks are pending
Build and Test / build (push) Waiting to run
725faf64a4
standardize: port 7365→3387, pkg name heroforge→hero_forge
Some checks are pending
Build and Test / build (push) Waiting to run
Build and Test / build (pull_request) Waiting to run
5b10de2389
fix: Makefile compliance - move port-killing to scripts/stop-ports.sh
Some checks are pending
Build and Test / build (pull_request) Waiting to run
Build and Test / build (push) Waiting to run
a0ad3567f4
- Replace inline for-loop port killing with bash scripts/stop-ports.sh
- Per makefile_helper skill
standardize: rename hyphenated package names to snake_case, fix herolib deps
Some checks failed
Build and Test / build (pull_request) Waiting to run
Build and Test / build (push) Failing after 2s
8aa8aa3072
- heroforge-webdav-client → heroforge_webdav_client
- heroforge-dav-test → heroforge_dav_test
- heroforge-ui → heroforge_ui
- herolib-core/herolib-os → herolib_core/herolib_os (git deps)
- Version-only herolib deps → git URL deps pointing to hero_lib repo

Per naming_convention: all package names must use snake_case.
ci: restrict test triggers to PRs and push to development/main
Some checks are pending
Build and Test / build (pull_request) Waiting to run
fcef2f2b7b
Stop triggering test/build workflows on every push to every branch.
Tests now run only on:
- push to development or main (post-merge validation)
- pull_request targeting development or main (pre-merge check)
- manual workflow_dispatch

Per forge_ci skill: Standard Workflow Triggers convention.
standardize: rename heroforge-dav-test.rs to heroforge_dav_test.rs
Some checks are pending
Build and Test / build (pull_request) Waiting to run
dbac10fd0a
File name now matches [[bin]] path in Cargo.toml.
standardize: switch git dep branches to development
Some checks failed
Build and Test / build (pull_request) Failing after 1m37s
c5a65c7fea
Preparation for merge: all git dependency branch refs changed from
development_hero_zero_standardize to development. After hero_lib PR
merges first, all downstream deps resolve on development branch.
Update OpenRPC schema and UI components
Some checks failed
Build and Test / build (push) Failing after 1m41s
edb5dfd545
Enhance OpenRPC schema definitions, server methods, and UI templates with improved routing, state management, and global navbar functionality.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Add Unix socket binding support (--bind unix:/path) and /health endpoint
Some checks failed
Build and Test / build (push) Failing after 37s
32e6d1b9f3
- Change run_server to accept string bind address instead of SocketAddr
- Add --bind flag: "unix:/path" for Unix socket, "host:port" for TCP
- Add GET /health route returning "ok" for hero_proxy health checks

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix type mismatch in route handler match arms
Some checks failed
Build and Test / build (push) Failing after 1m35s
95cf8c97fa
Remove erroneous Ok() wrapper from /health arm to match the other
arms which return Response directly (wrapped in Ok at the end).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
# Conflicts:
#	Cargo.toml
#	src/bin/heroforge-core.rs
#	src/fs/commit_thread.rs
#	src/fs/fs_interface.rs
#	src/fs/interface.rs
#	src/server/webdav/dav_fs.rs
Apply cargo fmt and fix all clippy warnings
Some checks failed
Build and Test / build (pull_request) Failing after 1m40s
96f1a1b581
Collapsible if-let chains, needless borrows, zombie process fixes,
field_reassign_with_default, and formatting cleanup across src and tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
timur changed target branch from main to development 2026-02-19 05:41:39 +00:00
timur merged commit c3a9c6b756 into development 2026-02-19 05:41:50 +00:00
timur deleted branch clippy-fixes-and-clap 2026-02-19 05:41:57 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_fossil!1
No description provided.