-
Notifications
You must be signed in to change notification settings - Fork 27
refactor: Remove dylints #4183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
refactor: Remove dylints #4183
Changes from all commits
c013fb7
142d301
7f9324e
a6d89dd
c09446d
e167710
ef07d02
6c5b615
f451bbf
44ed3de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Gears manifest. Used by `cargo gears` CLI for linting and other tasks. | ||
| # See https://github.com/constructorfabric/cargo-gears for documentation. | ||
|
|
||
| [apps.gears-rust.dev] | ||
| config = "lint.yml" | ||
| gears = [] | ||
|
|
||
| [apps.gears-rust.dev.lint] | ||
| fmt = false # already handled by `make fmt` | ||
| clippy = false # already handled by `make clippy` | ||
|
|
||
| [apps.gears-rust.dev.lint.dylint] | ||
| enabled = true | ||
| # Remove entries as violations are fixed or cargo-gears-lints is updated. | ||
| skip = [ | ||
| # New lint not yet addressed in this repo. | ||
| "de0504_client_versioning", | ||
| # Path exclusion logic in cargo-gears-lints uses "modules/" prefix but this | ||
| # repo uses "gears/". Skipped until cargo-gears-lints adds "gears/" support. | ||
| "de1101_tests_in_separate_files", | ||
| # Scope broadened from /contract/ to /domain/ in cargo-gears-lints. | ||
| # Pre-existing code in domain/ layers needs migration. | ||
| "de0101_no_serde_in_contract", | ||
| "de0102_no_toschema_in_contract", | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -138,8 +138,7 @@ setup: .setup-stamp | |
| cargo install lychee | ||
| cargo install cargo-geiger | ||
| cargo install cargo-deny | ||
| cargo install cargo-dylint | ||
| cargo install dylint-link | ||
| cargo install cargo-gears | ||
| cargo install cargo-fuzz | ||
| cargo install cargo-hack | ||
| cargo install gts-validator | ||
|
|
@@ -169,7 +168,6 @@ setup: .setup-stamp | |
| fmt: | ||
| $(call check_rustup_component,rustfmt) | ||
| cargo fmt --all --check | ||
| cargo fmt --all --check --manifest-path tools/dylint_lints/Cargo.toml | ||
|
|
||
| # -------- Gear naming validation -------- | ||
|
|
||
|
|
@@ -213,16 +211,8 @@ validate-gear-names: | |
| # | | - Missing documentation warnings | | ||
| # | | - Ensures clean compilation across all targets and features | | ||
| # +-------------+----------------------------------------------------------------------+ | ||
| # | dylint | - Project-specific architectural conventions (custom lints) | | ||
| # | | - DTO declaration and placement (only in api/rest folders) | | ||
| # | | - DTO isolation (no references from domain/contract layers) | | ||
| # | | - API endpoint versioning requirements (e.g., /users/v1/users) | | ||
| # | | - Contract layer purity (no serde, HTTP types, or ToSchema) | | ||
| # | | - Layer separation and dependency rules enforcement | | ||
| # | | - Use 'make dylint-list' to see all available custom lints | | ||
| # +-------------+----------------------------------------------------------------------+ | ||
|
|
||
| .PHONY: clippy clippy-deep lychee docs-preview kani geiger safety lint dylint dylint-list dylint-test shear gts-docs cfs-ensure cfs-repair cfs-validate cfs-validate-kits cfs-validate-kit-local cfs-spec-coverage | ||
| .PHONY: clippy clippy-deep lychee docs-preview kani geiger safety lint dylint shear gts-docs cfs-ensure cfs-repair cfs-validate cfs-validate-kits cfs-validate-kit-local cfs-spec-coverage | ||
|
|
||
| CFS ?= cfs | ||
| CFS_PIPX_SPEC ?= git+https://github.com/constructorfabric/studio.git | ||
|
|
@@ -297,7 +287,7 @@ cfs-validate-kit-local: cfs-repair | |
| # Run markdown checks with 'lychee' | ||
| lychee: | ||
| $(call check_tool,lychee) | ||
| lychee --exclude-path 'docs/web-docs' docs examples tools/dylint_lints guidelines | ||
| lychee --exclude-path 'docs/web-docs' docs examples guidelines | ||
|
|
||
| # Preview the documentation website with local docs/web-docs content. | ||
| # Clones the web docs site into .web-docs-preview/ and serves it at localhost:4321. | ||
|
|
@@ -335,34 +325,15 @@ gts-docs: | |
| install-tools: | ||
| @command -v cargo-nextest >/dev/null 2>&1 || cargo install --locked cargo-nextest | ||
|
|
||
| ## List all custom project compliance lints (see tools/dylint_lints/README.md) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, where do we replace current dylint by 'cargo gears xxx' ?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @maurolacy also it's a good UX improvement to have a list argument in the lint section for dylint. This way we offer a list of the available lints |
||
| dylint-list: | ||
| @cd tools/dylint_lints && \ | ||
| DYLINT_LIBS=$$(find target/release -maxdepth 1 \( -name "libde*@*.so" -o -name "libde*@*.dylib" -o -name "de*@*.dll" \) -type f | sort -u); \ | ||
| if [ -z "$$DYLINT_LIBS" ]; then \ | ||
| echo "ERROR: No dylint libraries found. Run 'make dylint' first to build them."; \ | ||
| exit 1; \ | ||
| fi; \ | ||
| for lib in $$DYLINT_LIBS; do \ | ||
| echo "=== $$lib ==="; \ | ||
| cargo dylint list --lib-path "$$lib"; \ | ||
| done | ||
|
|
||
| ## Test dylint lints on UI test cases (compile and verify violations) | ||
| dylint-test: install-tools | ||
| @cd tools/dylint_lints && cargo nextest run | ||
|
|
||
| # Run project compliance dylint lints on the workspace (see `make dylint-list`) | ||
| # Run architecture lints via cargo-gears (see Gears.toml for configuration). | ||
| dylint: | ||
| $(call check_tool,cargo-dylint) | ||
| $(call check_tool,dylint-link) | ||
| cargo dylint --all --workspace | ||
| $(call check_tool,cargo-gears) | ||
| cargo gears lint --dylint | ||
|
|
||
| # Check for unused dependencies with cargo-shear. | ||
| shear: | ||
| $(call check_tool,cargo-shear) | ||
| cargo +nightly-2026-04-16 shear --expand --deny-warnings | ||
| cd tools/dylint_lints && cargo shear --expand --deny-warnings | ||
|
|
||
| # Run all code safety checks | ||
| safety: clippy kani lint dylint # geiger | ||
|
|
@@ -428,7 +399,6 @@ dev-fmt: | |
| ## Auto-fix clippy warnings | ||
| dev-clippy: | ||
| cargo clippy --workspace --all-targets --all-features --fix --allow-dirty | ||
| @cd tools/dylint_lints && cargo clippy --all-targets --workspace | ||
|
|
||
| # Auto-fix formatting and clippy warnings | ||
| dev: dev-fmt dev-clippy dev-test | ||
|
|
@@ -815,14 +785,14 @@ oop-example: | |
| cargo run --bin cf-gears-example-server --features oop-example,users-info-example,static-authn,static-authz,static-tenants,static-credstore -- --config config/quickstart.yaml run | ||
|
|
||
| # Run all quality checks | ||
| check: .setup-stamp fmt cfs-validate clippy lychee security dylint-test dylint gts-docs test | ||
| check: .setup-stamp fmt cfs-validate clippy lychee security dylint gts-docs test | ||
|
|
||
| ci_test: fmt clippy | ||
|
|
||
| ci_docs: lychee gts-docs | ||
|
|
||
| # Run CI pipeline locally, requires docker | ||
| ci: fmt clippy test-no-macros test-macros test-db deny test-users-info-pg lychee gts-docs dylint dylint-test | ||
| ci: fmt clippy test-no-macros test-macros test-db deny test-users-info-pg lychee gts-docs dylint | ||
|
|
||
| # Build the cf-gears-example-server release binary using a toolchain from the rust-toolchain.toml | ||
| cargo-build: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # Minimal config file required by the Gears manifest for linting. | ||
| server: {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmm, I can't see how we replacing it, it's being just removed.
Where is the new 'cargo gears lint' command in CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maurolacy let's take the approach of installing the cargo-gears here and use the lint functionality.
Create a basic manifest target to lint all gears from here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All right; will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.