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

Fix dart analyze and format on 3.7.0 #2513

Merged
merged 13 commits into from
Feb 13, 2025
Merged

Fix dart analyze and format on 3.7.0 #2513

merged 13 commits into from
Feb 13, 2025

Conversation

ntkme
Copy link
Contributor

@ntkme ntkme commented Feb 12, 2025

This PR fixes the following:

warning • lib/src/deprecation.dart:185:43 • A value for optional parameter 'description' isn't ever given. Try removing the unused parameter. • unused_element_parameter
   info • lib/sass.dart:6:9 • Library names are not necessary. Remove the library name. • unnecessary_library_name
   info • pkg/sass_api/lib/sass_api.dart:6:9 • Library names are not necessary. Remove the library name. • unnecessary_library_name

There are a few deprecated_member_use on dart:js_util, but migrate to dart:js is not a small task so that I'm not touching those for now.


For dart format this PR adds dart pub get before running dart format in CI to make sure the language version is correctly detected and a consistent format is produced.

@ntkme ntkme changed the title Fix dart analyze issues on 3.7.0 Fix dart analyze and format on 3.7.0 Feb 12, 2025
@ntkme ntkme force-pushed the fix-dart-analyze branch 2 times, most recently from 05c6f80 to 788c916 Compare February 12, 2025 20:47
@ntkme
Copy link
Contributor Author

ntkme commented Feb 12, 2025

@nex3 I just found out that with dart 3.7, if you start with a clean clone of the repo (or run git clean -dffx), it formats in one way. Then, after running dart pub get, it formats in another way...

@ntkme
Copy link
Contributor Author

ntkme commented Feb 12, 2025

It's mentioned in the changelog: /~https://github.com/dart-lang/sdk/blob/main/CHANGELOG.md#dart-format

In order to correctly determine the language version of each file it formats, dart format (like other dart commands) looks for a package_config.json file surrounding the files being formatted. This means that you need to run dart pub get before formatting code in your package. If you have format checks in your continuous integration server, you'll want to make sure it runs dart pub get too.

@nex3 nex3 merged commit 7ab44ef into sass:main Feb 13, 2025
39 checks passed
@ntkme ntkme deleted the fix-dart-analyze branch February 13, 2025 23:27
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