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

constant_identifier_names needs a class/enum-level override #204

Open
Hixie opened this issue Mar 14, 2016 · 6 comments
Open

constant_identifier_names needs a class/enum-level override #204

Hixie opened this issue Mar 14, 2016 · 6 comments
Labels
customer-flutter P3 A lower priority bug or feature request set-recommended Affects a rule in the recommended Dart rule set type-enhancement A request for a change that isn't a bug

Comments

@Hixie
Copy link

Hixie commented Mar 14, 2016

These names come from other systems or conventions and so we really don't want to camelCase them, but marking every single one of them is a non-starter. For example:

class Icons {
  Icons._();

  static const IconData threed_rotation = const IconData(0xe84d); // 3d_rotation isn't a valid identifier.
  static const IconData ac_unit = const IconData(0xeb3b);
  static const IconData access_alarm = const IconData(0xe190);
  static const IconData access_alarms = const IconData(0xe191);
  static const IconData access_time = const IconData(0xe192);
  static const IconData accessibility = const IconData(0xe84e);
  static const IconData accessible = const IconData(0xe914);
  static const IconData account_balance = const IconData(0xe84f);
  static const IconData account_balance_wallet = const IconData(0xe850);
  static const IconData account_box = const IconData(0xe851);
  static const IconData account_circle = const IconData(0xe853);
  static const IconData adb = const IconData(0xe60e);
....
......
.........

(from https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/material/icons.dart)

Another example:

enum TargetPlatform {
  android_arm,
  ios_arm,
  ios_x64,
  darwin_x64,
  linux_x64
}

(From https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/build_configuration.dart)

@pq
Copy link
Member

pq commented Jun 27, 2018

@Hixie : when you have a sec, I'm curious if/how you're dealing w/ this.

(Related to: #883.)

@Hixie
Copy link
Author

Hixie commented Jun 27, 2018

We have this lint commented out, with a pointer to this bug.

@pq
Copy link
Member

pq commented Jun 27, 2018

Ah, k. Thanks for the update!

@zoechi
Copy link

zoechi commented Jun 28, 2018

// ignore_for_file: constant_identifier_names is for the whole file but would that not be enough?

@pq pq added the type-enhancement A request for a change that isn't a bug label Jun 29, 2018
@Hixie
Copy link
Author

Hixie commented Aug 18, 2018

@zoechi Not really, because often these are just a bunch of values on an enum in a file full of other stuff.

@Hixie
Copy link
Author

Hixie commented Oct 8, 2021

i think having an enum-level or class-level ignore for this would probably be sufficient for most cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-flutter P3 A lower priority bug or feature request set-recommended Affects a rule in the recommended Dart rule set type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants