-
Notifications
You must be signed in to change notification settings - Fork 185
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
Deprecate v0.Rule and remove it from tests #1379
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am surprised to see scalafix.v0.Rule
was not deprecated, we should definitely do it 👍
Regarding the removal of SyntacticRuleSuite
and the significant signature changes in AbstractSyntacticRuleSuite
, I am not sure there is a need to do that without a deprecation heads up first (so that any corporate user would report back here if it's a big problem)?
The testkit is very little documented (apart from the tutorial in the docs that uses https://github.com/olafurpg/named-literal-arguments which should probably be moved to the scalacenter org) so I wonder if it wouldn't be a good occasion to move away from Scalatest (both for syntactic and semantic rules) as discussed in #1172 (comment) (causing scala/community-build#1290).
We could deprecate all Scalatest helpers to advertize new munit-based ones in a v1
package matching the rules (where we could also but the semantic helper, even though it is not coupled to the v1 model?). And for Scalafix 1.0, we drop the Scalatest helpers/dependency?
@@ -17,61 +19,46 @@ import scalafix.v0._ | |||
* | |||
* @param rule the default rule to use from `check`/`checkDiff`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
obsolete doc
scalafix-testkit/src/main/scala/scalafix/testkit/AbstractSyntacticRuleSuite.scala
Show resolved
Hide resolved
Even in the tutorial about tests, and the repo namedLiteral, they only use this
I do like the simplicity of the tests in scalafix!
You said we should |
Unfortunately,
You're right, it's acceptable to drop it since it only impacts rule authors - what matters is to be more conservative with
Yes, advertize new traits with a Actually, regarding the |
SemanticRuleSuite is deprecated. we can maybe start by removing just SemanticRuleSuite and SyntacticRuleSuite, this way we don't depend on old versions of scalatest? |
By bumping ScalaTest here, we make it very hard for ScalaTest 3.0 clients to use the testkit (I think it would still be possible to use |
the impact of removing SemanticRule would be as easy to fix as this for authors rule |
- We delete old seemanticRuleSuite and SyntacticRuleSuite classes. - We introduce a breaking change on AbstractSyntacticRuleSuite, which now tests v1.Rule
This commit includes: Deprecating v0.Rule |
This commit includes:
Next step: Create a migration rule to help to migrate from SemanticRuleSuite to AbstractSemanticRuleSuite.