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

Add bin/packs lint_deprecated_references command #55

Merged
merged 5 commits into from
Nov 18, 2022

Conversation

alexevanczuk
Copy link
Contributor

@alexevanczuk alexevanczuk commented Nov 17, 2022

Note that this will be changed to lint_package_todo once packwerk 3.x is released.

This is extracted from Gusto's codebase. The idea is that we want to ensure that no one receives a noisy diff when running bin/packwerk update-deprecations. We use this in our CI suite.

OUTPUT

puts output
UsePackwerk.config.on_deprecated_references_lint_failure.call(output)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

At Gusto, we can configure this like this:

--- /dev/null
+++ b/config/use_packwerk.rb
@@ -0,0 +1,7 @@
+require 'gusto_packwerk'
+
+module GustoPackwerk
+  UsePackwerk.configure do |config|
+    config.on_deprecated_references_lint_failure = -> (output) { Private.post_buildkite_annotation(output) }
+  end
+end

I don't love this exactly... some alternative ideas were to have this method return a Result type with the output, and we could just do whatever we want with that result. However, I liked the idea that we can use the vanilla bin stub (bin/packs lint_deprecated_references) without needing to orchestrate anything else.

@alexevanczuk alexevanczuk merged commit b46acd4 into main Nov 18, 2022
@alexevanczuk alexevanczuk deleted the ae-ensure-consistent branch November 18, 2022 16:54
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.

2 participants