Skip to content

config: C14 Check unused externs#1009

Merged
BrettMayson merged 6 commits intomainfrom
unusedExtern
Jun 26, 2025
Merged

config: C14 Check unused externs#1009
BrettMayson merged 6 commits intomainfrom
unusedExtern

Conversation

@PabstMirror
Copy link
Copy Markdown
Collaborator

might be a smell that something is wrong with configs
unless there is a legit reason to extern things that are not used?

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 20, 2025

Codecov Report

Attention: Patch coverage is 82.76836% with 61 lines in your changes missing coverage. Please review.

Project coverage is 68.0%. Comparing base (69d6a3f) to head (dfbf978).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...bs/config/src/analyze/lints/c14_unused_external.rs 84.3% 37 Missing ⚠️
bin/src/commands/check.rs 0.0% 10 Missing ⚠️
libs/common/src/config/project/hemtt/mod.rs 33.3% 8 Missing ⚠️
libs/workspace/src/lint/mod.rs 84.0% 4 Missing ⚠️
libs/sqf/src/analyze/mod.rs 80.0% 1 Missing ⚠️
libs/stringtable/src/analyze/mod.rs 91.6% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
bin/src/modules/rapifier.rs 79.3% <100.0%> (-0.2%) ⬇️
bin/src/modules/sqf.rs 60.5% <100.0%> (-0.3%) ⬇️
bin/src/modules/stringtables.rs 57.0% <100.0%> (-0.4%) ⬇️
libs/common/src/config/mod.rs 50.0% <ø> (ø)
libs/config/src/analyze/lints/c01_invalid_value.rs 76.2% <100.0%> (+0.3%) ⬆️
...config/src/analyze/lints/c02_duplicate_property.rs 75.7% <100.0%> (+0.1%) ⬆️
.../config/src/analyze/lints/c03_duplicate_classes.rs 71.8% <100.0%> (+0.1%) ⬆️
...s/config/src/analyze/lints/c04_external_missing.rs 72.2% <100.0%> (+0.1%) ⬆️
...nfig/src/analyze/lints/c05_external_parent_case.rs 77.7% <100.0%> (+0.1%) ⬆️
...s/config/src/analyze/lints/c06_unexpected_array.rs 73.9% <100.0%> (+0.2%) ⬆️
... and 43 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@PabstMirror PabstMirror marked this pull request as ready for review June 21, 2025 00:10
@BrettMayson BrettMayson requested a review from Copilot June 22, 2025 06:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new lint to check for unused external classes in the configuration and updates relevant tests and configuration files accordingly. Key changes include:

  • Adding a snapshot file that records the expected lint warnings.
  • Enabling the new lint in the project tests configuration.
  • Implementing the lint logic and tree traversal for detecting unused externs.
  • Minor adjustments in duplicate external declarations and dependency updates.

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
libs/config/tests/snapshots/lints__config_error_c14_unused_external.snap Adds snapshot output for unused extern warnings
libs/config/tests/lints/project_tests.toml Enables the new lint in the test configuration
libs/config/tests/lints/c14_unused_external.hpp Defines test classes exhibiting unused extern behavior
libs/config/tests/lints/c03_duplicate_external.hpp Adjusts duplicate external declarations for consistency
libs/config/tests/lints.rs Registers the new lint call
libs/config/src/analyze/lints/c14_unused_external.rs Implements the lint analysis logic and reporting
libs/config/Cargo.toml Adds dependency on indexmap required by the new lint

BrettMayson and others added 2 commits June 25, 2025 14:00
* config: enable c14 by default

* change message

* Update bin/src/commands/check.rs

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

---------

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
@BrettMayson BrettMayson merged commit e47d885 into main Jun 26, 2025
36 of 37 checks passed
@BrettMayson BrettMayson deleted the unusedExtern branch June 26, 2025 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants