-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Set up Kotlin linting step in ci with ktlint #143478
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
Conversation
|
Example of the linting working: https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20analyze/73795/overview Just need to figure out
|
|
Baseline is also working, as the check passes now with it included |
|
@reidbaker FYI this is the pr in the state we discussed getting it to, where the decision just needs to be made if the linting tool should be on CIPD, or downloaded (current state) like the packages repo https://github.com/flutter/packages/blob/abb04bb89cca97e653764a60bde0ee4e816db322/script/tool/lib/src/format_command.dart#L39 (mod making some of the paths/executability of the file platform agnostic) |
Creates a [ktlint](https://github.com/pinterest/ktlint/) cipd package, for use in flutter/flutter#143478.
|
Support for adding a dependency on |
|
cc @keyonghan (sorry for the continued questions on this!) and seeing an error that the version tag doesn't exist Did I perhaps mess something up in this step? |
You need a full tag name: |
|
So instead of a reference, a tag may be more suitable for this case. (I need to update the doc again). |
Hmm so I originally ran Changing I also assume that I'm not going to have permission currently either way, so I'll open another access request |
|
Oh wait its probably supposed to be also |
|
Okay nevermind, I was setting the version wrong 🤦. Sorry about that! Looks like the step is succeeding now https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20analyze/76227/overview |
Add doc how to add a tag to a cipd instance. Context: flutter/flutter#143478
|
auto label is removed for flutter/flutter/143478, due to - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
auto label is removed for flutter/flutter/143478, due to - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
I'm pretty certain this does not affect g3 in any way (it only affects ci config, benchmarks, and a test file), so I'm going to override the google testing. I'm sorry if I was wrong 🙏 |
Post submit test passed https://critique.corp.google.com/cl/621639365 |
flutter/flutter@e868e2b...ac2ca93 2024-04-04 [email protected] Roll Flutter Engine from aadf522e3c98 to 4303dc0d7a73 (1 revision) (flutter/flutter#146262) 2024-04-04 [email protected] Roll Flutter Engine from c57c8665b4eb to aadf522e3c98 (1 revision) (flutter/flutter#146261) 2024-04-04 [email protected] Roll Flutter Engine from ca7596642cfd to c57c8665b4eb (1 revision) (flutter/flutter#146259) 2024-04-04 [email protected] Roll Flutter Engine from 83c037c449b5 to ca7596642cfd (1 revision) (flutter/flutter#146258) 2024-04-04 [email protected] Roll Flutter Engine from 614154012e93 to 83c037c449b5 (1 revision) (flutter/flutter#146255) 2024-04-04 [email protected] Roll Flutter Engine from 41da00ac46bc to 614154012e93 (1 revision) (flutter/flutter#146250) 2024-04-04 [email protected] Roll Flutter Engine from 18fdcad40332 to 41da00ac46bc (6 revisions) (flutter/flutter#146246) 2024-04-04 [email protected] Roll pub packages (flutter/flutter#146245) 2024-04-03 [email protected] Add tests for theme_extension.1.dart API example. (flutter/flutter#145819) 2024-04-03 [email protected] Roll Flutter Engine from 349608d2b008 to 18fdcad40332 (6 revisions) (flutter/flutter#146240) 2024-04-03 [email protected] Add `missing_code_block_language_in_doc_comment` lint. (flutter/flutter#145354) 2024-04-03 [email protected] Magnifier cleanup (flutter/flutter#143558) 2024-04-03 [email protected] Set up Kotlin linting step in ci with ktlint (flutter/flutter#143478) 2024-04-03 [email protected] Roll Flutter Engine from 1a9e48ab1c9a to 349608d2b008 (1 revision) (flutter/flutter#146230) 2024-04-03 [email protected] Update ownership to GitHub handles (flutter/flutter#146221) 2024-04-03 [email protected] Roll Flutter Engine from d065763b1a63 to 1a9e48ab1c9a (1 revision) (flutter/flutter#146226) 2024-04-03 [email protected] Refactor fuchsia_precache (flutter/flutter#145978) 2024-04-03 [email protected] Roll Flutter Engine from b1c23addaec5 to d065763b1a63 (1 revision) (flutter/flutter#146218) 2024-04-03 [email protected] `computeDryBaseline` for rendering / widgets RenderBoxes (flutter/flutter#146143) 2024-04-03 [email protected] Roll Flutter Engine from 7b28ae1d15cb to b1c23addaec5 (1 revision) (flutter/flutter#146214) 2024-04-03 [email protected] Fix TextStyle.lerp() to properly interpolate text shadows (flutter/flutter#145666) 2024-04-03 [email protected] Renderflex cross intrinsic size with baseline alignment (flutter/flutter#146185) 2024-04-03 [email protected] Roll Flutter Engine from 56fa2c33a5f7 to 7b28ae1d15cb (1 revision) (flutter/flutter#146208) 2024-04-03 [email protected] Refactor customer_testing (flutter/flutter#145911) 2024-04-03 [email protected] Add `DropdownMenu` cursor behavior sample (flutter/flutter#146133) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
|
This new test is breaking on the Dart CI, where we run the flutter analysis test with tip-of-tree Dart SDK. Alternatively, if there is a command-line option or environment variable to set to disable the klint checks, or if these could be made a separate test script, rather than adding them into the existing analyze.dart test, which otherwise just requires a normal framework installation. |
I'm fine reverting this and moving the new portion of the test to a different check/shard. We should also definitely add documentation noting that this check is copied and run in the dart ci as well. Are there other tests that also get copied? Is there a testowner that should be added for this check? I'm not particularly sure how one could know of or anticipate this problem. |
|
Can I ask why you run this test in the dart ci, with the latest dart? It seems like a significant portion of the checks it makes are functionality I wouldn't expect to be run anywhere else, or to be particularly tied to dart versions (things like 'Links for creating GitHub issues', 'Unexpected binaries...', 'All tool test files end in _test.dart...', etc). |
|
We only want to run any changes in the Dart analyzer and linter against the framework code, and this is the Flutter framework test that does that. We could extract just the relevant parts into commands run directly in our script, but then it has the danger of getting out-of-sync with what the flutter framework runs. But it does make sense to skip all of the non-relevant tests run by analyze.sh. OK, looking at it, I agree that we should extract the analyzer tests out to a separate set, since there are so many non-relevant tests in this suite. Either this suite could be split into two parts, or some option added to only run the analysis tests (but also on gallery and code snippets), or we would have to clone all the analysis test code into our script, with the disadvantages of code clones. So I don't think you should revert. |
The bots/flutter/analyze_flutter_flutter.sh script calls Flutter's [flutter]/dev/bots/analyze.dart test script. More tests have been added to that Flutter script, that test Flutter style guide policies and Kotlin lints. Avoid running all these tests, that do not depend on the Dart SDK being tested. Only run the tests from Flutter's analyze.dart test that use the Dart SDK analyzer. Bug: flutter/flutter#143478 Change-Id: I12142a019a8cbeb70b40ca028d13325303e8db61 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362483 Reviewed-by: Alexander Thomas <[email protected]>
flutter/flutter@e868e2b...ac2ca93 2024-04-04 [email protected] Roll Flutter Engine from aadf522e3c98 to 4303dc0d7a73 (1 revision) (flutter/flutter#146262) 2024-04-04 [email protected] Roll Flutter Engine from c57c8665b4eb to aadf522e3c98 (1 revision) (flutter/flutter#146261) 2024-04-04 [email protected] Roll Flutter Engine from ca7596642cfd to c57c8665b4eb (1 revision) (flutter/flutter#146259) 2024-04-04 [email protected] Roll Flutter Engine from 83c037c449b5 to ca7596642cfd (1 revision) (flutter/flutter#146258) 2024-04-04 [email protected] Roll Flutter Engine from 614154012e93 to 83c037c449b5 (1 revision) (flutter/flutter#146255) 2024-04-04 [email protected] Roll Flutter Engine from 41da00ac46bc to 614154012e93 (1 revision) (flutter/flutter#146250) 2024-04-04 [email protected] Roll Flutter Engine from 18fdcad40332 to 41da00ac46bc (6 revisions) (flutter/flutter#146246) 2024-04-04 [email protected] Roll pub packages (flutter/flutter#146245) 2024-04-03 [email protected] Add tests for theme_extension.1.dart API example. (flutter/flutter#145819) 2024-04-03 [email protected] Roll Flutter Engine from 349608d2b008 to 18fdcad40332 (6 revisions) (flutter/flutter#146240) 2024-04-03 [email protected] Add `missing_code_block_language_in_doc_comment` lint. (flutter/flutter#145354) 2024-04-03 [email protected] Magnifier cleanup (flutter/flutter#143558) 2024-04-03 [email protected] Set up Kotlin linting step in ci with ktlint (flutter/flutter#143478) 2024-04-03 [email protected] Roll Flutter Engine from 1a9e48ab1c9a to 349608d2b008 (1 revision) (flutter/flutter#146230) 2024-04-03 [email protected] Update ownership to GitHub handles (flutter/flutter#146221) 2024-04-03 [email protected] Roll Flutter Engine from d065763b1a63 to 1a9e48ab1c9a (1 revision) (flutter/flutter#146226) 2024-04-03 [email protected] Refactor fuchsia_precache (flutter/flutter#145978) 2024-04-03 [email protected] Roll Flutter Engine from b1c23addaec5 to d065763b1a63 (1 revision) (flutter/flutter#146218) 2024-04-03 [email protected] `computeDryBaseline` for rendering / widgets RenderBoxes (flutter/flutter#146143) 2024-04-03 [email protected] Roll Flutter Engine from 7b28ae1d15cb to b1c23addaec5 (1 revision) (flutter/flutter#146214) 2024-04-03 [email protected] Fix TextStyle.lerp() to properly interpolate text shadows (flutter/flutter#145666) 2024-04-03 [email protected] Renderflex cross intrinsic size with baseline alignment (flutter/flutter#146185) 2024-04-03 [email protected] Roll Flutter Engine from 56fa2c33a5f7 to 7b28ae1d15cb (1 revision) (flutter/flutter#146208) 2024-04-03 [email protected] Refactor customer_testing (flutter/flutter#145911) 2024-04-03 [email protected] Add `DropdownMenu` cursor behavior sample (flutter/flutter#146133) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Adds a kotlin linting step to the linux analyze check, using a version of ktlint hosted on CIPD.
Configured to disallow trailing commas, because of (and now acting as a test for) #145718. Because of this configuration the PR also removes some trailing commas in some kotlin files.
Also checks in a baseline file.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.