Skip to content

exclude generated_plugin_registrant.dart from analysis #79091

@goderbauer

Description

@goderbauer

Instead of opting generated_plugin_registrant.dart out of a growing list of individual lints can we just exclude it from analysis altogether?

// ignore_for_file: lines_longer_than_80_chars
{{#plugins}}
import 'package:{{name}}/{{file}}';
{{/plugins}}
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
// ignore: public_member_api_docs
void registerPlugins(Registrar registrar) {
{{#plugins}}
{{class}}.registerWith(registrar);
{{/plugins}}
registrar.registerMessageHandler();
}

I imagine we could list it in the exclude section [1] of the analyss_options_user.yaml file.

It would break customers that have a custom analyzer options file with public_member_api_docs and/or lines_longer_than_80_chars enabled. They'd have to add a similar opt-out section to their options file. In the future, when we generate an analyss_options.yaml file on flutter create (see #78432) we could auto-include that.

This change would help with enabling dart-lang/sdk#35234. Currently, those generated ignores are not always ignoring a warning and hence trigger a warning that they are unused.

And it would also stop us from having to add more opt-outs to that file in the future.

[1] https://dart.dev/guides/language/analysis-options#excluding-files
[2] https://github.com/flutter/flutter/blob/master/packages/flutter/lib/analysis_options_user.yaml

Metadata

Metadata

Assignees

Labels

P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy