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

dev-cmd: add brew typecheck command #8289

Merged
merged 4 commits into from
Aug 27, 2020

Conversation

vidusheeamoli
Copy link
Contributor

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew tests with your changes locally?

This PR adds a new brew typecheck developer command which checks for type errors in the current code with Sorbet.

@vidusheeamoli vidusheeamoli force-pushed the brew-typecheck branch 2 times, most recently from a4d25bf to 64107ad Compare August 10, 2020 21:51
Copy link
Member

@issyl0 issyl0 left a comment

Choose a reason for hiding this comment

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

Overall, good work - and speedy work, too! 🚀

I tested this out and there's some confusing behaviour with --file and --dir. Thankfully though, --quiet works and is very pleasing to my eyes. 🤣

Library/Homebrew/dev-cmd/typecheck.rb Outdated Show resolved Hide resolved
Library/Homebrew/dev-cmd/typecheck.rb Outdated Show resolved Hide resolved
Library/Homebrew/dev-cmd/typecheck.rb Outdated Show resolved Hide resolved
Library/Homebrew/dev-cmd/typecheck.rb Outdated Show resolved Hide resolved
Library/Homebrew/dev-cmd/typecheck.rb Outdated Show resolved Hide resolved
@MikeMcQuaid
Copy link
Member

Also: might be nice for this to have a --fail-if-not-changed like update-license-data to be able to use that from the workflow? It'll also be nice to e.g. have that CI job and/or this command run on PRs like #8364 to make sure they don't break things/introduce new warnings we haven't fixed yet?

@vidusheeamoli vidusheeamoli force-pushed the brew-typecheck branch 3 times, most recently from bed9844 to 1f2fdc6 Compare August 17, 2020 19:07
Library/Homebrew/dev-cmd/typecheck.rb Outdated Show resolved Hide resolved
Library/Homebrew/dev-cmd/typecheck.rb Outdated Show resolved Hide resolved
@vidusheeamoli vidusheeamoli force-pushed the brew-typecheck branch 2 times, most recently from 1f2c1ab to 470c863 Compare August 21, 2020 10:23
Library/Homebrew/dev-cmd/typecheck.rb Outdated Show resolved Hide resolved
Library/Homebrew/dev-cmd/typecheck.rb Outdated Show resolved Hide resolved
Library/Homebrew/dev-cmd/typecheck.rb Outdated Show resolved Hide resolved
Library/Homebrew/dev-cmd/typecheck.rb Outdated Show resolved Hide resolved
Library/Homebrew/dev-cmd/typecheck.rb Show resolved Hide resolved
This PR adds a new `brew typecheck` developer command which checks for
typechecking errors in the current code with Sorbet.
cd "$GITHUB_WORKSPACE/Library/Homebrew"
gem install bundler -v "~>1"
bundle install --jobs 4 --retry 3
run: brew typecheck --update-definitions
Copy link
Member

@dawidd6 dawidd6 Aug 26, 2020

Choose a reason for hiding this comment

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

Judging by the current source code, I would say this whole step is not needed.

This will allow us to verify that we can merge new sorbet/tapioca
updates.
description: "Silence all non-critical errors."
switch "--update-definitions",
description: "Update Tapioca gem definitions of recently bumped gems"
switch "--fail-if-not-changed",
Copy link
Member

Choose a reason for hiding this comment

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

Can we make this --fail-if-changed? The double negative is kind of confusing.

Copy link
Member

Choose a reason for hiding this comment

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

No, this matches -update-license-data.

Copy link
Member

Choose a reason for hiding this comment

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

Or at least: yes, it could but both would need to be updated (which is out of scope for this PR specifically).

@MikeMcQuaid MikeMcQuaid merged commit 2f3fb6f into Homebrew:master Aug 27, 2020
@MikeMcQuaid
Copy link
Member

Thanks @vidusheeamoli, great work here!

@@ -120,6 +120,9 @@ jobs:
- name: Run brew audit --skip-style on all taps
run: brew audit --skip-style

# TODO: remove --quiet when possible.
Copy link
Member

Choose a reason for hiding this comment

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

@vidusheeamoli I added this so we can ensure that PRs like #8505 are tested properly. Could you open a new PR to remove --quiet from here and fix and/or hide the current failures so that brew typecheck shows as clear by default? Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On it! 😄

@vidusheeamoli vidusheeamoli deleted the brew-typecheck branch September 2, 2020 07:32
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Dec 14, 2020
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Dec 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants