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

[Semester Project] Add new front-end phase for unused entities and add support for unused imports #16157

Merged
merged 54 commits into from
Jan 9, 2023

Commits on Sep 30, 2022

  1. Report simple unused import

    - report unused named import
    - no given or wildcard import
    - issue with method reference (e.g. apply, factory, ...)
    PaulCoral committed Sep 30, 2022
    Configuration menu
    Copy the full SHA
    27bfda8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    93ba6c9 View commit details
    Browse the repository at this point in the history

Commits on Oct 4, 2022

  1. Add warnings for unused wildcard imports

    Emits a warning when none of element of a wildcard ('_')
    import is used (i.e. a "unused import" warning).
    PaulCoral committed Oct 4, 2022
    Configuration menu
    Copy the full SHA
    f2c1551 View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2022

  1. Add tests and fixes for unused warning

    - Add various tests for unused warnings
    - Fix warning not emitted when imported object is used
      another scope
    PaulCoral committed Oct 8, 2022
    Configuration menu
    Copy the full SHA
    d6fa4cb View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2022

  1. Add warning unused given imports

    - Emit warning for unused given imports
    - Emit warning for wildcard imports when only given
      instances are used.
      ```
      import SomeGivenImports.given // OK
      import SomeGivenImports._ // error
      ```
    PaulCoral committed Oct 9, 2022
    Configuration menu
    Copy the full SHA
    9f75334 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b131601 View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2022

  1. Add tests for inline method

    PaulCoral committed Oct 10, 2022
    Configuration menu
    Copy the full SHA
    e37c2f9 View commit details
    Browse the repository at this point in the history

Commits on Oct 11, 2022

  1. Add an isRunnable for CheckUnused

    - Add an `isRunnable` methode to the `CheckUnused` phase
      to avoid unecessary costly checks (suggested by @bishabosha)
    - Move neg compilation tests out of folder
    PaulCoral committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    2d6da62 View commit details
    Browse the repository at this point in the history

Commits on Oct 14, 2022

  1. Configuration menu
    Copy the full SHA
    617155d View commit details
    Browse the repository at this point in the history
  2. Ignore exclusion when unused import

    - Do not emit any warning for import exclusion.
    - These are hard to interpret. These can be placed
      on purpose to avoid future usage of a symbol.
    PaulCoral committed Oct 14, 2022
    Configuration menu
    Copy the full SHA
    0801dd6 View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2022

  1. Configuration menu
    Copy the full SHA
    a6e7d05 View commit details
    Browse the repository at this point in the history
  2. Add "-Wunused:locals" warning support

    - Add a compiler settings for unused local definition
    - Add check for unused local variable in CheckUnused phase
    - Add some "neg-custom-args/fatal-warnings" checks for unused locals definition
    PaulCoral committed Oct 23, 2022
    Configuration menu
    Copy the full SHA
    e1188b6 View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2022

  1. Add "-Wunused:privates" warning option

    - Add the "privates" option for "-Wunused"
    - Implement "unused privates member" checks in "CheckUnused" phase
    - Add a test suit for the previous point
    PaulCoral committed Oct 24, 2022
    Configuration menu
    Copy the full SHA
    5447cdb View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2022

  1. Fix CheckUnused phasename

    PaulCoral committed Oct 25, 2022
    Configuration menu
    Copy the full SHA
    950e7de View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2022

  1. Configuration menu
    Copy the full SHA
    9ad1daa View commit details
    Browse the repository at this point in the history
  2. fix overlapping warning

    PaulCoral committed Oct 28, 2022
    Configuration menu
    Copy the full SHA
    5ecb0eb View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2022

  1. Configuration menu
    Copy the full SHA
    a1c2bae View commit details
    Browse the repository at this point in the history
  2. Fix warning location

    - Fix the position of unused warning (unused locals, unused privates)
      to the declaration name. This avoids hidden overlapping warning
    PaulCoral committed Oct 31, 2022
    Configuration menu
    Copy the full SHA
    f993782 View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2022

  1. Add -Wunused:params,explicits,implicits,patvars

    - Add warnings for unused parmaters (explicit, implicit)
    - Add warnings for unused pattern variables (in match case)
    - Add tests suits (fatal-warnings)
    PaulCoral committed Nov 6, 2022
    Configuration menu
    Copy the full SHA
    b2fd8cb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    368748a View commit details
    Browse the repository at this point in the history
  3. Merge branch 'feature/linter/unused' of github.com:PaulCoral/dotty in…

    …to feature/linter/unused
    PaulCoral committed Nov 6, 2022
    Configuration menu
    Copy the full SHA
    e69c4a3 View commit details
    Browse the repository at this point in the history

Commits on Nov 17, 2022

  1. Fix requested changes, add new tests

    - Fix minor changes
    - Add more tests
    - -Wunused:nowarn does not run the CheckUnused phase
    
    fix nowarn
    
    clean useless val
    PaulCoral committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    8ac97b3 View commit details
    Browse the repository at this point in the history
  2. Annotation usage, allow unsed Self, add tests

    - Register annotation usage, so (i.e. @tailrec) is not reported
    - Allow unsed self name (`self:A =>` members)
    - Add tests suggested in the PR discussion thread
    PaulCoral committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    892621b View commit details
    Browse the repository at this point in the history
  3. Refactor CheckUnused, fix pkg false negative

    - Refactor the sets of defs and usage symbols.
      This results in less objects created and less push-pop scope.
    - Fix false negative for imports in the same package
    PaulCoral committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    6d8d20d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    412412c View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2022

  1. Configuration menu
    Copy the full SHA
    f354b96 View commit details
    Browse the repository at this point in the history

Commits on Nov 23, 2022

  1. Remove report unused implicit imports

    - Named import pointing to an implicit
    - Given imports `import foo.bar.given`
    - Add new tests, remove the ones on implicit reporting
    PaulCoral committed Nov 23, 2022
    Configuration menu
    Copy the full SHA
    d41c6dd View commit details
    Browse the repository at this point in the history

Commits on Nov 24, 2022

  1. Revert to unused implicit check, also synthetics

    - Check implicit and given imports
    - Adapt check to some synthetic (@main, package object)
    - Add new tests to support these features
    PaulCoral committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    95c8a40 View commit details
    Browse the repository at this point in the history

Commits on Dec 5, 2022

  1. Add warn Annotated Types and "new" kw

    - Annotated types are reported as used
    - Some times class constructor "this" is used instead of apply
      It is registered as used
    - Some new tests
    PaulCoral committed Dec 5, 2022
    Configuration menu
    Copy the full SHA
    b2f0fa1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    82290c8 View commit details
    Browse the repository at this point in the history
  3. Reports more import alternatives

    - Reports more import alternatives (e.g. overloaded methods)
    PaulCoral committed Dec 5, 2022
    Configuration menu
    Copy the full SHA
    5a755dd View commit details
    Browse the repository at this point in the history
  4. Warn unused Imports methods overload

    - overloaded where not well resolved and thus not reported
    - also add a tests
    PaulCoral committed Dec 5, 2022
    Configuration menu
    Copy the full SHA
    2ed1f1f View commit details
    Browse the repository at this point in the history

Commits on Dec 12, 2022

  1. Configuration menu
    Copy the full SHA
    8a91af1 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'feature/linter/unused' of github.com:PaulCoral/dotty in…

    …to feature/linter/unused
    PaulCoral committed Dec 12, 2022
    Configuration menu
    Copy the full SHA
    ca8dbaf View commit details
    Browse the repository at this point in the history
  3. Fix typo in help -W

    PaulCoral committed Dec 12, 2022
    Configuration menu
    Copy the full SHA
    426d34a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5ab55f8 View commit details
    Browse the repository at this point in the history

Commits on Dec 13, 2022

  1. Add -Wunused:strict-no-implicit-warn warning option

    - Add the new -Wunused:strict-no-implicit-warn flag
    - Add a test suit i15503j
    PaulCoral committed Dec 13, 2022
    Configuration menu
    Copy the full SHA
    0cb2af0 View commit details
    Browse the repository at this point in the history
  2. Fix test i15503j

    PaulCoral committed Dec 13, 2022
    Configuration menu
    Copy the full SHA
    d1f9441 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e158a9f View commit details
    Browse the repository at this point in the history

Commits on Dec 14, 2022

  1. Clean, refine scope, add comments

    - Tidy the code (space, newline,...)
    - Refine the scope by making more things private
    - Add explaination and doc comments (mostly to help reviewer)
    PaulCoral committed Dec 14, 2022
    Configuration menu
    Copy the full SHA
    e2b6b61 View commit details
    Browse the repository at this point in the history

Commits on Dec 16, 2022

  1. Refactor CheckUnused into a MiniPhase

    - Add prepare and tranform method from MiniPhase
    - Keep previous implementation for cases not covered
      by MiniPhase traversal (Mostly in the type tree)
    PaulCoral committed Dec 16, 2022
    Configuration menu
    Copy the full SHA
    b0790d1 View commit details
    Browse the repository at this point in the history

Commits on Dec 26, 2022

  1. Add support for @annotation.unused

    - Does not report defs with @unused
    - Update the test suit
    PaulCoral committed Dec 26, 2022
    Configuration menu
    Copy the full SHA
    7f04ce3 View commit details
    Browse the repository at this point in the history
  2. Add support for trivial body

    - Params of method with trivial body are not reported as unused
    - Update the test suit
    PaulCoral committed Dec 26, 2022
    Configuration menu
    Copy the full SHA
    779ec7d View commit details
    Browse the repository at this point in the history

Commits on Dec 27, 2022

  1. Fix the import precedence in -Wunused:imports

    - Wildcard import are reported before named ones
    - Update the test suit
    PaulCoral committed Dec 27, 2022
    Configuration menu
    Copy the full SHA
    d37d99e View commit details
    Browse the repository at this point in the history
  2. Improve -Wunused:locals

    PaulCoral committed Dec 27, 2022
    Configuration menu
    Copy the full SHA
    ae24d64 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    527aa31 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    bfa20a1 View commit details
    Browse the repository at this point in the history

Commits on Dec 29, 2022

  1. Fixes for -Wunused:params

    - Also add a (adapted) Scala 2 tests suits
    PaulCoral committed Dec 29, 2022
    Configuration menu
    Copy the full SHA
    c70fa68 View commit details
    Browse the repository at this point in the history

Commits on Jan 3, 2023

  1. Add better support for trivial methods -Wunused

    - Method having a return type of "SingleType" (as named in Scala 2) are
      considered trivial (i.e. Nil, object X, object Y, None, ...)
    - Update test suits
    PaulCoral committed Jan 3, 2023
    Configuration menu
    Copy the full SHA
    7de90b3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c89e27c View commit details
    Browse the repository at this point in the history

Commits on Jan 4, 2023

  1. Configuration menu
    Copy the full SHA
    422ecb8 View commit details
    Browse the repository at this point in the history

Commits on Jan 5, 2023

  1. Configuration menu
    Copy the full SHA
    4a06bc6 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'feature/linter/unused' of github.com:PaulCoral/dotty in…

    …to feature/linter/unused
    PaulCoral committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    1db9040 View commit details
    Browse the repository at this point in the history
  3. Make -Wunused:patvars to unsafe

    - Suppress -Wunused:patvars
    - Replace by -Wunused:unsafe-warn-patvars
    PaulCoral committed Jan 5, 2023
    Configuration menu
    Copy the full SHA
    08f807c View commit details
    Browse the repository at this point in the history