Skip to content
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

chore: improve compiler warnings (DEV-1611) #2784

Merged
merged 5 commits into from
Aug 14, 2023

Conversation

BalduinLandolt
Copy link
Collaborator

Pull Request Checklist

Task Description/Number

Issue Number: DEV-

Basic Requirements

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • fix: represents bug fixes
  • refactor: represents production code refactoring
  • feat: represents a new feature
  • docs: documentation changes (no production code change)
  • chore: maintenance tasks (no production code change)
  • test: all about tests: adding, refactoring tests (no production code change)
  • other... Please describe:

Does this PR introduce a breaking change?

  • Yes
  • No
  • Maybe (not 100% sure => check with FE)

Does this PR change client-test-data?

  • Yes (don't forget to update the JS-LIB team about the change)
  • No

@linear
Copy link

linear bot commented Aug 10, 2023

DEV-1611 DSP-API: Add compiler flag to warn about unused code

Warnings about unused stuff would be helpful. However, false positives would be annoying. It has to be tried out how it feels.

In build.sbt, add:

    scalacOptions <ins></ins>= Seq(
      "-feature",
      "-unchecked",
      "-deprecation",
      "-Yresolve-term-conflict:package",
      "-Ymacro-annotations",
      // silence twirl templates unused imports warnings
      "-Wconf:src=target/.*:s",
      "-Wunused:imports"
      // probably nice to enable
      // "-Ywarn-unused:imports", // An import selector is not referenced.
      // "-Ywarn-unused:locals",  // A local definition is unused.
      // "-Ywarn-unused:params",  // A value parameter is unused.
      // "-Ywarn-unused:patvars", // A variable bound in a pattern is unused.
      // "-Ywarn-unused:privates" // A private member is unused.
      // not sure yet
      // "-Ywarn-unused:implicits", // An implicit parameter is unused.
      // "-Ywarn-value-discard",    // Non-Unit expression results are unused.
    ),```

then uncomment the commented out warnings, and see what happens.

(Note: `-Ywarn-unused:xxx` seems to do the same as `-Wunused:xxx`)

@swarmia
Copy link

swarmia bot commented Aug 10, 2023

✅  Linked to Story DEV-1611 · DSP-API: Add compiler flag to warn about unused
➡️  Part of Epic DEV-542 · C: DSP-API Issues

@codecov
Copy link

codecov bot commented Aug 10, 2023

Codecov Report

Patch coverage has no change and project coverage change: +69.84% 🎉

Comparison is base (12402f3) 18.00% compared to head (cca9d11) 87.84%.
Report is 32 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2784       +/-   ##
===========================================
+ Coverage   18.00%   87.84%   +69.84%     
===========================================
  Files         281      242       -39     
  Lines       28899    23393     -5506     
===========================================
+ Hits         5202    20550    +15348     
+ Misses      23697     2843    -20854     

see 219 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@BalduinLandolt BalduinLandolt self-assigned this Aug 11, 2023
@BalduinLandolt BalduinLandolt marked this pull request as ready for review August 14, 2023 10:04
@BalduinLandolt BalduinLandolt merged commit 00379ce into main Aug 14, 2023
13 checks passed
@BalduinLandolt BalduinLandolt deleted the wip/DEV-1611-compiler-warnings branch August 14, 2023 11:30
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.

None yet

3 participants