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

feat: no_support_multi_text_direction #62

Merged
merged 3 commits into from
Nov 19, 2023

Conversation

ronnnnn
Copy link
Member

@ronnnnn ronnnnn commented Nov 19, 2023

Overview

New lint rule no_support_multi_text_direction and quick fixes.

Feature type

  • Lint Rule
  • Quick fix
  • Assist
  • Other (Update docs, Configure CI, etc...)

@ronnnnn ronnnnn added docs Improvements or additions to documentation feat New feature or request labels Nov 19, 2023
Copy link
Contributor

github-actions bot commented Nov 19, 2023

Image description CodeRabbit

Walkthrough

The changes primarily introduce a new lint rule no_support_multi_text_direction and its quick fixes, which checks for TextDirection support in the code. Additionally, unnecessary elements like unused main functions, runApp calls, and certain widgets have been removed from various test files to streamline the code.

Changes

Files Summary
packages/nilts/README.md, packages/nilts/lib/nilts.dart, packages/nilts/lib/src/change_priority.dart, packages/nilts_test/test/lints/no_support_multi_text_direction.dart Introduced a new lint rule no_support_multi_text_direction that checks for TextDirection support in the code. Updated documentation with examples of good and bad practices related to TextDirection. Added new priorities for different lint rules.
packages/nilts_test/test/lints/defined_void_callback_type.dart Removed unused main function and MainApp class, retaining only the MainButton class. No changes to exported functions or global data structures.
packages/nilts_test/test/lints/fixed_text_scale_rich_text.dart Removed main function, runApp call, MaterialApp widget, and returned a Column widget with RichText instances directly. Two RichText widgets have properties set using MediaQuery methods.
packages/nilts_test/test/lints/shrink_wrapped_scroll_view.dart Removed main function, runApp call, and MaterialApp widget. Returned a Column widget with a list of ListView and GridView widgets directly. Set shrinkWrap property to true for all scrollable widgets.
packages/nilts_test/test/lints/unnecessary_rebuilds_from_media_query.dart Removed main function and moved runApp call to a separate file. Removed key parameter from the MainApp widget constructor.

Uplevel your code reviews with CodeRabbit Pro

CodeRabbit Pro

If you like this project, please support us by purchasing the Pro version. The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 0087f92 and 947c926 commits.
Files selected (9)
  • packages/nilts/README.md (3)
  • packages/nilts/lib/nilts.dart (2)
  • packages/nilts/lib/src/change_priority.dart (1)
  • packages/nilts/lib/src/lints/no_support_multi_text_direction.dart (1)
  • packages/nilts_test/test/lints/defined_void_callback_type.dart (1)
  • packages/nilts_test/test/lints/fixed_text_scale_rich_text.dart (1)
  • packages/nilts_test/test/lints/no_support_multi_text_direction.dart (1)
  • packages/nilts_test/test/lints/shrink_wrapped_scroll_view.dart (1)
  • packages/nilts_test/test/lints/unnecessary_rebuilds_from_media_query.dart (1)
Files not summarized due to errors (1)
  • packages/nilts/lib/src/lints/no_support_multi_text_direction.dart (diff tokens exceeds limit)
Files not reviewed due to errors (4)
  • packages/nilts/lib/src/change_priority.dart (no response)
  • packages/nilts/README.md (no response)
  • packages/nilts_test/test/lints/shrink_wrapped_scroll_view.dart (no response)
  • packages/nilts/lib/src/lints/no_support_multi_text_direction.dart (no response)
Files skipped from review due to trivial changes (3)
  • packages/nilts_test/test/lints/defined_void_callback_type.dart
  • packages/nilts_test/test/lints/fixed_text_scale_rich_text.dart
  • packages/nilts_test/test/lints/unnecessary_rebuilds_from_media_query.dart
Review comments generated (6)
  • Review: 3
  • LGTM: 3

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

import 'package:flutter/material.dart';

class Alignments extends StatelessWidget {
const Alignments({super.key});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The super.key is not a valid constructor for the StatelessWidget. It should be Key key and passed to the super class.

-  const Alignments({super.key});
+  const Alignments({Key key}) : super(key: key);

}

class Insets extends StatelessWidget {
const Insets({super.key});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Same issue as above, super.key is not a valid constructor for the StatelessWidget. It should be Key key and passed to the super class.

-  const Insets({super.key});
+  const Insets({Key key}) : super(key: key);

}

class Positions extends StatelessWidget {
const Positions({super.key});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Again, super.key is not a valid constructor for the StatelessWidget. It should be Key key and passed to the super class.

-  const Positions({super.key});
+  const Positions({Key key}) : super(key: key);

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

Successfully merging this pull request may close these issues.

1 participant