Skip to content

Conversation

sarroutbi
Copy link
Contributor

@sarroutbi sarroutbi commented Sep 3, 2025

The new workflow runs on every push and pull request to the master branch and performs the following checks:

  • cargo build: Compiles the main application.
  • cargo test: Compiles the test suite.

Both steps are executed with the RUSTFLAGS="-D warnings" environment variable. This flag instructs the Rust compiler to treat all warnings as fatal errors, which will cause the build to fail if any warnings are present. This helps prevent latent bugs and ensures the code base remains clean.

These are some reasons to enforce a "No Warnings" Policy:

  1. Future-Proofing Code: A warning in the current version of a compiler might become a hard error in a future version. Code that compiles with warnings today may fail to compile tomorrow after a simple rustup update, causing unexpected build failures. Enforcing a "no warnings" policy ensures your code is robust against compiler updates.

  2. Preventing Latent Bugs: Many warnings are not just stylistic suggestions; they often point to subtle logical flaws, potential null pointer dereferences, race conditions, or undefined behavior. A classic example is an "unused variable" warning, which can indicate that a necessary calculation was performed but its result was never used.

  3. Improving Code Readability and Reducing Noise: When a build produces dozens of warnings, developers become desensitized to them. This "warning fatigue" can cause them to miss a new, critical warning that appears among the noise. A clean, warning-free build ensures that any new message from the compiler gets immediate attention.

  4. Maintaining a Culture of Quality: A strict "no warnings" policy sets a high standard for the team. It encourages developers to write clean, precise, and intentional code, fostering a culture where quality is not negotiable.

@sarroutbi sarroutbi force-pushed the 202509030938-fail-compilation-on-warnings branch from fe3610d to 1ffaa0c Compare September 3, 2025 07:45
@sarroutbi
Copy link
Contributor Author

This will be kept until compilation warnings are fixed in master branch. Once they are, new job should PASS and it should be merged to keep master branch clean

@sarroutbi sarroutbi changed the title Make compilation to fail on warnings [DONOTMERGEYET] Make compilation to fail on warnings Sep 3, 2025
@sarroutbi sarroutbi force-pushed the 202509030938-fail-compilation-on-warnings branch 3 times, most recently from a3b1702 to 6da554c Compare September 3, 2025 08:32
@sarroutbi sarroutbi marked this pull request as draft September 3, 2025 09:14
Copy link

codecov bot commented Sep 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.09%. Comparing base (ce52222) to head (0672ac6).

Additional details and impacted files
Flag Coverage Δ
e2e-testsuite 58.09% <ø> (ø)
upstream-unit-tests 58.09% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sarroutbi sarroutbi force-pushed the 202509030938-fail-compilation-on-warnings branch from 6da554c to 5a00dd1 Compare September 3, 2025 11:28
@sarroutbi sarroutbi force-pushed the 202509030938-fail-compilation-on-warnings branch from 5a00dd1 to 0672ac6 Compare September 3, 2025 15: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.

1 participant