Skip to content

CHANGELOG

Nishanth Shanmugham edited this page Nov 26, 2022 · 57 revisions

Note: The changelog lists notable changes in a given tag in comparison to the previous tag.

v0.9.0

  • Add support for checking exhaustiveness for values whose type is a type parameter (#31, f71d526).
  • Type conversion in case clause expression no longer produce a false positive diagnostic. (#42, f71d526).
  • The diagnostic message now always include the package name, even if the symbol is in the same package as the offending line. For rationale, see commit message for commit f71d526.

v0.8.3

Documentation fixes.

v0.8.2

  • Add support for checking map literals. Specify -check=switch,map to check map literals for exhaustiveness, in addition to switch statements.
  • Add -check flag, which specifies the program elements (e.g. switch statements, map literals) that should be checked. The default value is "switch".
  • The diagnostic message now lists missing member names in AST order instead of lexicographical order (#41).

v0.8.1

v0.8.0 was accidentally tagged in a non-master branch. v0.8.1, which is effectively the same as v0.8.0, has been tagged correctly on master.

v0.8.0

  • exhaustive now strictly follows the go/ast definition for associated comments. Previously, directive comments like the one below would have been associated with the switch statement.

    switch x { //exhaustive:ignore
    

    Now they must be moved like so to have effect:

    //exhaustive:ignore
    switch x {
    
  • Add -explicit-exhaustive-switch flag. The description for the flag is: only run exhaustive check on switches with "//exhaustive:enforce" comment.

  • Fix #37. Previously, due to a bug in the comment association logic, exhaustive would have inadvertently missed to check inner (i.e. nested) switch statements if a parent switch statement was marked "//exhaustive:ignore". This has been fixed such that the inner switch statement is now checked. (To ignore the inner switch statement, you should explicitly mark it with "//exhaustive:ignore".)

  • Upgrade golang.org/x/tools dependency.

v0.7.11

  • Documentation changes.
  • Switch links from pkg.go.dev to godocs.io.

v0.7.5–v0.7.10

Documentation improvements.

v0.7.4

Fix detection of generated files. Account for this requirement:

This line must appear before the first non-comment, non-blank text in the file.

http://golang.org/s/generatedcode

v0.7.3

  • Dot-imported package constants in case clause work correctly; previously they would be incorrectly reported as missing in the switch.
  • Improve support for same-valued type alias constants.

v0.7.2

IgnoreDirectivePrefix constant no longer exported. (Its behavior still remains the same though.)

v0.7.1

Rename PackageScopeOnly constant to PackageScopeOnlyFlag.

v0.7.0

  • Address issue #13: define/implement behavior for checking exhaustiveness of type aliased enums. The related documentation is available in the package comment in file doc.go or can be found on the pkg.go.dev page, under the new section 'Exhaustiveness and type aliases'.

v0.6.0

  • Fix issue #23: same-named enum type in package scope and in inner scope could produce incorrect diagnostic.
  • Address issue #11: The analyzer can now find enums defined in non-package scopes (e.g. inside function body). Switch statements using non-package scoped enums can now be checked for exhaustiveness.
  • The new flag -package-scope-only controls the behavior described in the previous item. If enabled, only package-scoped enums are detected. The flag is off by default, which means that enums in inner scopes will also be found. If you encounter an issue with the new behavior, set -package-scope-only and create an issue.
  • Documentation changes.

v0.5.0

  • Flag -checking-strategy is deprecated and no longer has any effect. The default checking strategy "value" is the strategy in use and is the only available strategy.
  • Internal: The analyzer code assumes that constant values can always be determined for enum members. This should be a valid assumption because only const can be enum members.

v0.4.0

  • var declarations cannot be enum members; only const can be.

v0.3.7

  • Previously the analzyer incorrectly determined constant values for enum members; this has been fixed. This is noticable in e.g. iota constants.
  • Previously the analzyer failed to determine constant values for enum members when it could have; this has been fixed. This is most noticable for iota constants.

v0.3.6

  • If pass.ImportPackageFact fails, it is reported as a diagnostic via pass.Report. Previously this would result in a returned error from the Analzyer's Run function.
  • Upgrade golang.org/x/tools dependency.

v0.3.5

Fixed a bug in detection of generated files; the following comment was incorrectly detected as indicative of a generated file.

// Code generated DO NOT EDIT.

v0.3.4

Documentation changes.

v0.3.3

Documentation changes.

v0.3.2

Documentation changes.

v0.3.1

Documentation changes.

v0.3.0

  • The flag -ignore-pattern has no effect and is deprecated. Instead see the new flag -ignore-enum-members, which has the same syntax and behavior.
  • A new -checking-strategy flag has been added; see package documentation for details.
  • The analyzer no longer suggests fixes.

Earlier tags

(No changelog available.)

Clone this wiki locally