20 Commits

Author SHA1 Message Date
df0f423184 [tools] Run pub get before format (#8052)
The new Dart formatter needs to know the Dart language version of the
code it is formatting, and it reads that from a file in `.dart_tool`,
not `pubspec.yaml` directly. To avoid it failing to determine the
version and assuming the latest (which will almost always be wrong in
this repo):
- Adds a step to the `format` repo command to ensure that `pub get`
appears to have been run, and runs it if not, and
- To avoid `pub get` running in `format` in CI, adds a deps-fetching
step to the `repo_checks` task, as we have in other tasks that need to
`pub get`.

This should unblock the roll.
2024-11-11 14:55:30 -05:00
aea93d2a51 Skip podspec Swift Search Path validation if only swift file is Package.swift (#6627)
Usually when an iOS plugin uses Swift files, it requires a workaround in the podspec to add Swift to the search paths. Part of the `podspec-check` command is validating this workaround is found. However, when the only Swift file is the `Package.swift` (Swift Package Manager manifest), skip this validation since having this file does not indicate the plugin uses Swift files.

Fixes https://github.com/flutter/flutter/issues/147548.
2024-04-30 23:43:18 +00:00
92330dbd2c Enable no_leading_underscores_for_local_identifiers (#6509) 2022-09-28 18:22:46 +00:00
9974a8ef44 [tool] Clean up "plugin" references (#6503) 2022-09-27 19:43:04 +00:00
d20563f6f4 Uncomments avoid_redundant_argument_values in analysis_options.yaml (#6163) 2022-08-08 23:52:06 +00:00
4cecb9b264 [flutter_plugin_tools] Adds update-excerpts command (#5339) 2022-04-28 09:34:11 -07:00
5bd3ae6a0a [flutter_plugin_tools] Fix license-check on Windows (#4425) 2021-10-20 08:03:04 -07:00
769043d35a [flutter_plugin_tools] Check licenses in Kotlin (#4373)
The license check overlooked Kotlin, since it's not currently widely
used in our repositories.

Also adds the missing license to one Kotlin file, from an example that
was (likely accidentally) re-generated using Kotlin instead of Java.
2021-09-28 06:20:20 -07:00
ca5e753486 [flutter_plugin_tools] Improve license-check output (#4154)
Currently each type of check handles its output in isolation, which
creates confusing output when the last check succeeds but an earlier
check fails, since the end of the output will just be a success message.

This makes the output follow the same basic approach as the package
looper commands, where all failures are collected, and then a final
summary is presented at the end, so the last message will always reflect
the important details.

It also adopts the colorized output now used by most other commands.
2021-07-13 13:25:41 -07:00
6ccb344119 [flutter_plugin_tools] Move license-check tests to runCapturingPrint (#4107) 2021-06-30 11:21:05 -07:00
10486b0ceb [flutter_plugin_tools] Split common.dart (#4057)
common.dart is a large-and-growing file containing all shared code,
which makes it hard to navigate. To make maintenance easier, this splits
the file (and its test file) into separate files for each major
component or category.
2021-06-16 12:37:30 -07:00
bb0a1ea161 [flutter_plugin_tools] Simplify filesystem usage (#4014)
- Replaces most explicit use of `fileSystem` with path construction using the `child*` utility methods
- Removes explicit passing of a filesystem to the commands; we're already passing a `Directory` for the
  root where the tool operates, and we should never be using a different filesystem than that directory's
  filesystem, so passing it was both redundant, and a potential source of test bugs.
2021-06-05 13:32:24 -04:00
842ae94fde Migrate some tool commands to NNBD (#3899)
Now that individual commands can be migrated, migrate several commands
that are trivially migratable.

Part of https://github.com/flutter/flutter/issues/81912
2021-05-17 11:25:01 -07:00
bd0081258a Begin migrating tools to NNBD (#3891)
- Updates dependencies to null-safe versions
- Migrates common.dart (which doesn't depend on anything)
- Migrates common_tests.dart and its one dependency, utils.dart
- Adds build_runner for Mockito mock generation
- Adds a new utility methods for getting arguments that handle both the casting and the removal of nullability to address a common problematic pattern while migrating code.
  - Converts all files, not just the migrated ones, to those new helpers.

Migrating common.dart and utils.dart should unblock a command-by-command migration to null safety.

Reverts the separate of podspect lints into a step that doesn't do a Flutter upgrade
(https://github.com/flutter/plugins/pull/3700) because without that step we had a
version of Dart too old to run null-safe tooling.

First step of https://github.com/flutter/flutter/issues/81912
2021-05-14 20:04:26 -04:00
a0ca28bac6 Update third_party license checking (#3844)
In preparation for enabling license checks in flutter/packages, update
the allowed licenses:
- Allow our license, for cases where we've locally added files
- Allow the license used by the bsdiff package
2021-05-04 10:53:44 -07:00
3d9e523218 Switch script/tools over to the new analysis options (#3777)
Removes the legacy analysis options override and fixes all resulting issues. This is a combination of dart fix and manual changes (mostly mechanical, but some small restructuring to address warnings more cleanly, such as creating typed structs from args when they are used repeatedly to avoid repeated casting, or making things that were unnecessarily public private).

One small opportunistic extra cleanup is that the handling of null-safety prerelease versions is removed, as any new plugin would be written null-safe from the start, so we no longer need to allow those versions.

Part of flutter/flutter#76229
2021-04-06 13:04:25 -07:00
aef6008b7b Standardize copyright year (#3737)
Standardizes all first-party copyrights on a single year, as is done in flutter/flutter and flutter/engine. All code now uses 2013, which is the earliest year that was in any existing copyright notice.

The script checks now enforce the exact format of first-party licenses and copyrights.

Fixes flutter/flutter#78448
2021-03-19 13:18:00 -07:00
c956cb3270 Standardize Copyrights: Chromium->Flutter (#2996)
In all copyright messages (and in the Xcode project organization name) standardize on "The Flutter Authors", adding "The Chromium Authors" to the Flutter AUTHORS list. This reduces inconsistency in the copyright lines in this repository, moving closer to a single consistent copyright+license (as in flutter/engine and flutter/flutter)

Updates the validation script to no longer accept "The Chromium Authors" or "the Chromium project authors" in first-party code.
2021-03-18 19:05:33 -04:00
c7b35882b4 Fix cosmetic variations in copyrights and license files (#3730)
- Replaces "the Flutter project authors" with the repo-standard version "The Flutter Authors"
  - Updates the license check not to allow "the Flutter project authors" in the future
- Fixes a few minor cosmetic variations that had crept back into LICENSE files since my
  mass-standardization of those files.
  - Updates the license check to validate those to prevent such drift in the future.
2021-03-18 13:28:44 -07:00
6141051fa2 Add missing licenses, and add a check (#3720)
Adds a new CI check that all code files have a copyright+license block (and that it's one we are expecting to see).

Fixes the ~350 files (!) that did not have them. This includes all of the files in the .../example/ directories, following the example of flutter/flutter. (This does mean some manual intervention will be needed when generating new example directories in the future, but it's one-time per example.)

Also standardized some variants that used different line breaks than most of the rest of the repo (likely added since I standardized them all a while ago, but didn't add a check for at the time to enforce going forward), to simplify the checks.

Fixes flutter/flutter#77114
2021-03-16 17:50:51 -04:00