Skip to content

Conversation

faddat
Copy link
Contributor

@faddat faddat commented Dec 30, 2023

This PR uses revive in largely the same manner as ibc-go does, and is targeted at the pbst branch.

It also became a great illustration of test flakiness:

In the course of writing this PR, all of the above tests were identified to be flaky. We don't know if that is the test, or the code it is testing, please keep in mind.

important

please don't merge or attempt to review this before merging #1906.


PR checklist

  • Tests written/updated
  • Changelog entry added in .changelog (we use unclog to manage our changelog)
  • Updated relevant documentation (docs/ or spec/) and code comments

@faddat faddat changed the title unused-recievers use revive in the same way we do in ibc-go Dec 30, 2023
github-merge-queue bot pushed a commit that referenced this pull request Feb 1, 2024
This is cherry-picked from:

* #1907

There were a number of opportunities to simplify code in comet by using
revive's if-return and early-return linters. This PR does not enable the
linters as default, but instead just applies the fixes suggested by
them.

There are two cases where I've marked conditionals with //nolint --
they're both a little bit odd and it may make sense to look deeper into
weather it is possible to benefit from early returns.

As we've seen in the break statements in #1907 using a linter can help
to enforce good practices across the entire repository and uncover
issues.

## inspired by

* #2156 

---

#### PR checklist

- [x] Tests written/updated
- [x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [x] Updated relevant documentation (`docs/` or `spec/`) and code
comments
- [x] Title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec

---------

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
mergify bot pushed a commit that referenced this pull request Feb 1, 2024
This is cherry-picked from:

* #1907

There were a number of opportunities to simplify code in comet by using
revive's if-return and early-return linters. This PR does not enable the
linters as default, but instead just applies the fixes suggested by
them.

There are two cases where I've marked conditionals with //nolint --
they're both a little bit odd and it may make sense to look deeper into
weather it is possible to benefit from early returns.

As we've seen in the break statements in #1907 using a linter can help
to enforce good practices across the entire repository and uncover
issues.

## inspired by

* #2156

---

#### PR checklist

- [x] Tests written/updated
- [x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [x] Updated relevant documentation (`docs/` or `spec/`) and code
comments
- [x] Title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec

---------

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
(cherry picked from commit eda385c)

# Conflicts:
#	test/e2e/pkg/infra/docker/docker.go
@melekes
Copy link
Contributor

melekes commented Feb 1, 2024

FYI, we're waiting for PBTS https://github.com/cometbft/cometbft/tree/feature/pbts to land on main.

@faddat
Copy link
Contributor Author

faddat commented Feb 4, 2024

Note to maintainers: I've merged PBTS into this branch. Will make a PR from the latest commit to the pbts branch, and a PR to main from 2606eb3.

Note to self:
2606eb3 is the last commit before merging the pbst branch into here, can PR to main from 2606eb3

@faddat faddat requested a review from a team as a code owner February 4, 2024 07:07
@faddat faddat changed the base branch from main to feature/pbts February 4, 2024 07:13
@faddat faddat mentioned this pull request Feb 4, 2024
4 tasks
@faddat faddat changed the title feat: enable revive linter feat: enable revive linter on the pbst branch Feb 4, 2024
Copy link
Contributor

@sergio-mena sergio-mena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PBTS is a feature branch. The way we use these branches is that only changes relevant to the feature being worked on should land directly from a PR.
The rest should be reviewed and committed to main. And, via the periodic merges from main into the feature branch that we do, we will eventually get those changes. But, by planning the moment of those merges, we choose when those changes are to land on the feature branch.

@faddat
Copy link
Contributor Author

faddat commented Feb 7, 2024

OK, figure I should close this @sergio-mena ?

I was basically trying to reduce future diffs.

could just keep merging main to the other one.

@sergio-mena
Copy link
Contributor

sergio-mena commented Feb 7, 2024

@faddat yes, please close this PR. I understand you are introducing the same changes on main via a different PR. So we'll eventually get them here in our next merge

@lasarojc lasarojc changed the title feat: enable revive linter on the pbst branch feat: enable revive linter on the pbts branch Feb 7, 2024
@faddat
Copy link
Contributor Author

faddat commented Feb 10, 2024

@sergio-mena the reason for this PR is that @melekes let me know that we were waiting for pbts to hit main. I will close it for now, it can be reopened later if need be. Could be a good reference later.

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.

4 participants