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

attempt: don't run unused when targeting feature branches. #3819

Merged
merged 6 commits into from
Jun 14, 2023

Conversation

DimitrisJim
Copy link
Contributor

@DimitrisJim DimitrisJim commented Jun 12, 2023

Description

Allows skipping certain linter checks on pull requests that do not target the main branch. Only disallow unused atm but could include more.

closes: #3783

Commit Message / Changelog Entry

type: commit message

see the guidelines for commit messages. (view raw markdown for examples)


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md).
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/).
  • Added relevant godoc comments.
  • Provide a commit message to be used for the changelog entry in the PR description for review.
  • Re-reviewed Files changed in the Github PR explorer.
  • Review Codecov Report in the comment section below once CI passes.

Copy link
Contributor

@chatton chatton left a comment

Choose a reason for hiding this comment

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

Rather than have two separate tasks than conditionally run, could we dynamically determine exclusions (e.g. if main isn't the base branch)?

This solution feels a little clunky, I'm happy to merge this as a short term workaround as we definitely don't care about some some of these linting errors while working on a feature branch.

But I think a better solution is to either have 2 lint yml configs (one for main and one for feature branches)

Or to dynamically pass arguments to --exclude if it's feasible.

WDYT?

Comment on lines +11 to +12
branches-ignore:
- main
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines +11 to +12
branches:
- main
Copy link
Contributor Author

Choose a reason for hiding this comment

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

only run on PRs targeting main (one is a negation of the other).

@DimitrisJim
Copy link
Contributor Author

Talked with Cian a bit this morning and going with separate workflow files. Since their number is getting rather large, am documenting as I add.

Copy link
Contributor

@chatton chatton left a comment

Choose a reason for hiding this comment

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

LGTM! I think separate workflows does make a bit more sense to keep each one as straightforward as possible 👍

@DimitrisJim DimitrisJim merged commit 3092171 into 04-channel-upgrades Jun 14, 2023
@DimitrisJim DimitrisJim deleted the no-lint-unused branch June 14, 2023 11:13
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