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

FEDX-530: Remove sdk_version_<language_feature> rules #200

Merged
merged 2 commits into from Nov 17, 2023

Conversation

evanweible-wf
Copy link
Contributor

@evanweible-wf evanweible-wf commented Nov 17, 2023

On older versions of Dart (early days of 2.x), the process around introducing new language features wasn't as mature as it is today. If you used a language feature without raising the SDK minimum for your package to the appropriate version, you'd get a diagnostic from the analyzer but it wasn't an error. So, this package promoted those diagnostics to errors to ensure that you wouldn't miss them.

Here are the rules that we configured:

Rule Docs Supported since Dart
sdk_version_async_exported_from_core link 2.1.0
sdk_version_as_expression_in_const_context link 2.3.2
sdk_version_bool_operator_in_const_context link 2.3.2
sdk_version_eq_eq_operator_in_const_context link 2.3.2
sdk_version_extension_methods link 2.6.0
sdk_version_is_expression_in_const_context link 2.3.2
sdk_version_set_literal link 2.2.0
sdk_version_ui_as_code link 2.3.0
sdk_version_ui_as_code_in_const_context link 2.5.0

Dart 3.2.0 was just released and dropped support for those diagnostics, meaning that any package with an analysis_options.yaml that includes those rules would receive a warning from the analyzer like this:

warning • analysis_options.yaml:1:10 • Warning in the included options file workiva_analysis_options/lib/v2.yaml(3923..3944): 'sdk_version_ui_as_code' isn't a recognized error code. • included_file_warning

For the diagnostics listed above, the corresponding language features have been supported since Dart 2.6 or earlier. This package already specifies a minimum SDK version of 2.12.0, so there's no need to include these rules any longer.

@aviary3-wk
Copy link

Security Insights

No security relevant content was detected by automated scans.

Action Items

  • Review PR for security impact; comment "security review required" if needed or unsure
  • Verify aviary.yaml coverage of security relevant code

Questions or Comments? Reach out on Slack: #support-infosec.

@rmconsole6-wk rmconsole6-wk changed the title Remove sdk_version_<language_feature> rules FEDX-530 Remove sdk_version_<language_feature> rules Nov 17, 2023
@bender-wk bender-wk changed the title FEDX-530 Remove sdk_version_<language_feature> rules FEDX-530: Remove sdk_version_<language_feature> rules Nov 17, 2023
@evanweible-wf
Copy link
Contributor Author

QA +1

  • Tested in a package on Dart 3.2 and it no longer warns about these rules.

@Workiva/release-management-p

Copy link

@rmconsole-wf rmconsole-wf left a comment

Choose a reason for hiding this comment

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

+1 from RM

@rmconsole6-wk rmconsole6-wk merged commit 4091df2 into master Nov 17, 2023
8 checks passed
@rmconsole6-wk rmconsole6-wk deleted the remove-sdk_version-rules branch November 17, 2023 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants