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

Remove or adjust some controversial rules #14

Closed
Sadhorsephile opened this issue May 3, 2024 · 2 comments
Closed

Remove or adjust some controversial rules #14

Sadhorsephile opened this issue May 3, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@Sadhorsephile
Copy link

Problem

Some of the rules are of dubious benefit.

  1.      - avoid-accessing-collections-by-constant-index

    Question is - how we'll be process such cases?

      final someString = 'some-decoded-id-in-the-middle';
      final parts = someString.split('-');
      assert(parts.length == 6, 'Incorrect format');
      return parts[2];
    }
  2.        - avoid-explicit-type-declaration

    I used to avoid reduntant getter like this:

    class SomeWm extends WidgetModel<SomeWidget> {
       @override
       final ValueNotifier<int> counter = ValueNotifier(0);
    }
    
    abstract class ISomeWm extends IWidgetModel<SomeWidget> {
        ValueListenable<int> get counter;
    }

    I have to declare type explicitly. Will it work with this rule?

  3.      - avoid-long-files:
               max-length: 500         

    What about situations, when we have many private widgets for one screen? They are not reusable and have to be private.

  4.   - avoid-long-functions:

    Does it rule work also for build method?

Copy link

github-actions bot commented May 3, 2024

Link to Pyrus task

@Sadhorsephile
Copy link
Author

  1. It's okay because you can declare index variables/constants and use them::
  const indexOfId = 2;

  final someString = 'some-decoded-id-in-the-middle';
  final parts = someString.split('-');
  assert(parts.length == 6, 'Incorrect format');
  return parts[indexOfId];
}
  1. We don't have this rule right now.

  2. This is a rare case, in such cases it can be ignored.

  3. Similar to 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant