Skip to content
  • Ethan Reesor's avatar
    chore(all): add custom analyzers [AC-1517] · 0f90dbf4
    Ethan Reesor authored
    Closes AC-1517. Add two custom analyzers:
    
    - 'noprint' catches print statements. We should be using the logger for basically everything, and adding print statements is common for debugging. Debugging print statements should not be merged.
    - 'rangevarref' catches cases where the body of a for-loop captures a reference to a value-type range variable. The analyzer doesn't know how to determine if a value escapes the stack, so it plays it safe by assuming all values escape. This leads to false positives, but dealing with false positives is much better than having bugs because of false negatives.
    
    ## Review Checklist
    
    **If any item is not complete, the merge request is not ready to be reviewed and must be marked `Draft:`.**
    
    - [x] The merge request title is in the format `<change type>(<change scope>): <short description> [<task id>]`
      - For example, `feat(cli): add QR code generation [AC-123]`
      - For details, see [CONTRIBUTING.md](/CONTRIBUTING.md)
    - [x] The description includes `Closes <jira task ID>` (or rarely `Updates <jira task ID>`)
    - [x] The change is fully validated by tests that are run during CI
      - In most cases this means a test in "validate.sh"
      - In some cases, a Go test may be acceptable
      - Validation is not applicable to things like documentation updates
      - Purely UI/UX changes can be manually validated, such as changes to human-readable output
      - For all other changes, automated validation tests are an absolute requirement unless a maintainer specifically explains why they are not in a comment on this merge request
    - [x] The change is marked with one of the validation labels
      - ~"validation::ci/cd" for changes validated by CI tests
      - ~"validation::manual" for changes validated by hand
      - ~"validation::deferred" for changes validated by a follow up merge request
      - ~"validation::not applicable" for changes where validation is not applicable
    
    ## Merge Checklist
    
    - [x] CI is passing
    - [x] Merge conflicts are resolved
    - [x] All discussions are resolved
    
    Related to AC-1517
    0f90dbf4