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

New Rule: Missing Assertion Method #84

Merged
merged 1 commit into from
May 7, 2023
Merged

New Rule: Missing Assertion Method #84

merged 1 commit into from
May 7, 2023

Conversation

nunnatsa
Copy link
Owner

@nunnatsa nunnatsa commented May 7, 2023

Description

The linter warns when calling an "actual" method (e.g. Expect(), Eventually() etc.), without an assertion method (e.g Should(), NotTo() etc.)

For example:

// no assertion for the result
Eventually(doSomething).WithTimeout(time.Seconds * 5).WithPolling(time.Milliseconds * 100)

The linter will not suggest a fix for this warning.

This rule cannot be suppressed.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Added test case and related test data
  • Update the functional test

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I ran golangci-lint

@github-actions
Copy link

github-actions bot commented May 7, 2023

Pull Request Test Coverage Report for Build 4906458581

  • 42 of 47 (89.36%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 84.592%

Changes Missing Coverage Covered Lines Changed/Added Lines %
gomegahandler/handler.go 10 15 66.67%
Totals Coverage Status
Change from base Build 4830797408: 0.2%
Covered Lines: 840
Relevant Lines: 993

💛 - Coveralls

The linter warns when calling an "actual" method (e.g. `Expect()`, `Eventually()` etc.),
without an assertion method (e.g `Should()`, `NotTo()` etc.)

For example:

```
// no assertion for the result
Eventually(doSomething).WithTimeout(time.Seconds * 5).WithPolling(time.Milliseconds * 100)
```

The linter will not suggest a fix for this warning.

This rule cannot be suppressed.
@nunnatsa nunnatsa merged commit 6390f72 into main May 7, 2023
1 check passed
@nunnatsa nunnatsa deleted the no-assertion-rule branch May 7, 2023 09:33
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

1 participant