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(ci): add pr spell check #221

Merged
merged 10 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/pr-spelling.template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: pr-spell-check
on: [pull_request]

jobs:
run:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check spelling
uses: crate-ci/typos@master
with:
config: .github/workflows/typos-config.toml
6 changes: 6 additions & 0 deletions .github/workflows/typos-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
default.check-filename = true

[default.extend-words]

[files]
extend-exclude = ["project.pbxproj","aop_flutter_sdk.patch"]
2 changes: 1 addition & 1 deletion tdesign-component/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ linter:
- empty_statements
# 不要出现可以在编译阶段推算出恒true或者false的条件判断
- invariant_booleans
# 当containns方法的参数和可枚举的类型不同,不要触发可枚举类型的contains方法
# 当contains方法的参数和可枚举的类型不同,不要触发可枚举类型的contains方法
- iterable_contains_unrelated_type
# 用小写加下划线做库的命名
- library_prefixes
Expand Down
6 changes: 3 additions & 3 deletions tdesign-component/example/assets/api/tab-bar_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| showBage | bool | - | 是否展示消息 |
| tdBadge | TDBadge? | - | 消息样式(未设置但showBage为true,则默认使用红点) |
| showBadge | bool | - | 是否展示消息 |
| tdBadge | TDBadge? | - | 消息样式(未设置但showBadge为true,则默认使用红点) |
| badgeTopOffset | double? | - | 消息顶部偏移量 |
| badgeRightOffset | double? | - | 消息右侧偏移量 |

Expand Down Expand Up @@ -72,7 +72,7 @@
| popUpWidth | double? | - | 弹窗宽度(不设置,默认为按钮宽度 - 20) |
| popUpitemHeight | double? | _kDefaultMenuItemHeight | 单个选项高度 所有选项等高 不设置则使用默认值 48 |
| backgroundColor | Color? | - | 弹窗背景颜色 |
| radius | double? | - | pannel圆角 默认0 |
| radius | double? | - | panel圆角 默认0 |
| arrowWidth | double? | - | 箭头宽度 默认13.5 |
| arrowHeight | double? | - | 箭头高度 默认8 |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
selectedIcon: _selectedIcon,
unselectedIcon: _unSelectedIcon,
badgeConfig: BadgeConfig(
showBage: true,
showBadge: true,
tdBadge: const TDBadge(TDBadgeType.redPoint),
badgeTopOffset: -2,
badgeRightOffset: -10,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Widget _expansionPannelTypeTabBar(BuildContext context) {
Widget _expansionPanelTypeTabBar(BuildContext context) {
return TDBottomTabBar(
TDBottomTabBarBasicType.expansionPanel,
useVerticalDivider: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
selectedIcon: _selectedIcon,
unselectedIcon: _unSelectedIcon,
badgeConfig: BadgeConfig(
showBage: true,
showBadge: true,
tdBadge: const TDBadge(TDBadgeType.redPoint),
badgeTopOffset: -2,
badgeRightOffset: -10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
selectedIcon: _selectedIcon,
unselectedIcon: _unSelectedIcon,
badgeConfig: BadgeConfig(
showBage: true,
showBadge: true,
tdBadge: const TDBadge(TDBadgeType.redPoint),
badgeTopOffset: -2,
badgeRightOffset: -10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
navigationTabs: [
TDBottomTabBarTabConfig(
badgeConfig: BadgeConfig(
showBage: true,
showBadge: true,
tdBadge: const TDBadge(TDBadgeType.redPoint),
badgeTopOffset: -2,
badgeRightOffset: -10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
padding: const EdgeInsets.all(0),
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (contet, index) {
itemBuilder: (context, index) {
var title = '多选';
if(index == 0){
title = '全选';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
padding: const EdgeInsets.all(0),
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (contet, index) {
itemBuilder: (context, index) {
var title = '多选';
return TDCheckbox(
id: 'index:$index',
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
padding: const EdgeInsets.all(0),
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (contet, index) {
itemBuilder: (context, index) {
var title = '单选';
return TDRadio(
id: 'index:$index',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Widget _verticleRadios(BuildContext context) {
Widget _verticalRadios(BuildContext context) {
return TDRadioGroup(
selectId: 'index:1',
child: ListView.builder(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</dependencies>
<scenes>
<!--Flutter View Controller-->
<scene sceneID="tne-QT-ifu">
<scene sceneID="the-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
<layoutGuides>
Expand Down
4 changes: 2 additions & 2 deletions tdesign-component/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:tdesign_flutter/src/util/log.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';

import 'base/example_route.dart';
import 'base/intl_resouce_delegate.dart';
import 'base/intl_resource_delegate.dart';
import 'config.dart';
import 'home.dart';

Expand Down Expand Up @@ -86,7 +86,7 @@ class _MyAppState extends State<MyApp> {
Map<String, WidgetBuilder> _getRoutes() {
if (PlatformUtil.isWeb) {
return {for (var model in examplePageList) model.name: (context) => model.pageBuilder.call(context, model)}
..putIfAbsent('/', () => (context) => const MyHomePage(title: 'TDesgin Flutter 组件库'));
..putIfAbsent('/', () => (context) => const MyHomePage(title: 'TDesign Flutter 组件库'));
} else {
return const {};
}
Expand Down
12 changes: 6 additions & 6 deletions tdesign-component/example/lib/page/td_bottom_tab_bar_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class _TDBottomTabBarPageState extends State<TDBottomTabBarPage> {
}),
ExampleItem(
desc: '双层级文本标签栏',
builder: _expansionPannelTypeTabBar,
builder: _expansionPanelTypeTabBar,
),
],
),
Expand Down Expand Up @@ -552,7 +552,7 @@ class _TDBottomTabBarPageState extends State<TDBottomTabBarPage> {
}

@Demo(group: 'bottomTabBar')
Widget _expansionPannelTypeTabBar(BuildContext context) {
Widget _expansionPanelTypeTabBar(BuildContext context) {
return TDBottomTabBar(
TDBottomTabBarBasicType.expansionPanel,
useVerticalDivider: true,
Expand Down Expand Up @@ -613,7 +613,7 @@ class _TDBottomTabBarPageState extends State<TDBottomTabBarPage> {
navigationTabs: [
TDBottomTabBarTabConfig(
badgeConfig: BadgeConfig(
showBage: true,
showBadge: true,
tdBadge: const TDBadge(TDBadgeType.redPoint),
badgeTopOffset: -2,
badgeRightOffset: -10,
Expand Down Expand Up @@ -650,7 +650,7 @@ class _TDBottomTabBarPageState extends State<TDBottomTabBarPage> {
selectedIcon: _selectedIcon,
unselectedIcon: _unSelectedIcon,
badgeConfig: BadgeConfig(
showBage: true,
showBadge: true,
tdBadge: const TDBadge(TDBadgeType.redPoint),
badgeTopOffset: -2,
badgeRightOffset: -10,
Expand Down Expand Up @@ -691,7 +691,7 @@ class _TDBottomTabBarPageState extends State<TDBottomTabBarPage> {
selectedIcon: _selectedIcon,
unselectedIcon: _unSelectedIcon,
badgeConfig: BadgeConfig(
showBage: true,
showBadge: true,
tdBadge: const TDBadge(TDBadgeType.redPoint),
badgeTopOffset: -2,
badgeRightOffset: -10,
Expand Down Expand Up @@ -770,7 +770,7 @@ class _TDBottomTabBarPageState extends State<TDBottomTabBarPage> {
selectedIcon: _selectedIcon,
unselectedIcon: _unSelectedIcon,
badgeConfig: BadgeConfig(
showBage: true,
showBadge: true,
tdBadge: const TDBadge(TDBadgeType.redPoint),
badgeTopOffset: -2,
badgeRightOffset: -10,
Expand Down
4 changes: 2 additions & 2 deletions tdesign-component/example/lib/page/td_checkbox_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class TDCheckboxPageState extends State<TDCheckboxPage> {
padding: const EdgeInsets.all(0),
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (contet, index) {
itemBuilder: (context, index) {
var title = '多选';
if(index == 0){
title = '全选';
Expand Down Expand Up @@ -271,7 +271,7 @@ class TDCheckboxPageState extends State<TDCheckboxPage> {
padding: const EdgeInsets.all(0),
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (contet, index) {
itemBuilder: (context, index) {
var title = '多选';
return TDCheckbox(
id: 'index:$index',
Expand Down
6 changes: 3 additions & 3 deletions tdesign-component/example/lib/page/td_radio_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class TDRadioPageState extends State<TDRadioPage> {
backgroundColor: const Color(0xfff6f6f6),
children: [
ExampleModule(title: '组件类型', children: [
ExampleItem(desc: '纵向单选框', builder: _verticleRadios),
ExampleItem(desc: '纵向单选框', builder: _verticalRadios),
ExampleItem(desc: '横向单选框', builder: _horizontalRadios),
]),
ExampleModule(title: '组件状态', children: [
Expand All @@ -57,7 +57,7 @@ class TDRadioPageState extends State<TDRadioPage> {
}

@Demo(group: 'radio')
Widget _verticleRadios(BuildContext context) {
Widget _verticalRadios(BuildContext context) {
return TDRadioGroup(
selectId: 'index:1',
child: ListView.builder(
Expand Down Expand Up @@ -199,7 +199,7 @@ class TDRadioPageState extends State<TDRadioPage> {
padding: const EdgeInsets.all(0),
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (contet, index) {
itemBuilder: (context, index) {
var title = '单选';
return TDRadio(
id: 'index:$index',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ class TDDropdownItem<T> extends StatefulWidget {

static const double operateHeight = 73;

double? get minContenHeight =>
double? get minContentHeight =>
multiple == true ? (minHeight != null ? minHeight! + TDDropdownItem.operateHeight : null) : minHeight;
double? get maxContenHeight =>
double? get maxContentHeight =>
multiple == true ? (maxHeight != null ? maxHeight! + TDDropdownItem.operateHeight : null) : maxHeight;

@override
Expand Down Expand Up @@ -117,15 +117,15 @@ class _TDDropdownItemState extends State<TDDropdownItem> {
Widget _getCheckboxList() {
var paddingNum = TDTheme.of(context).spacer16;
var groupCunck = _groupChunkOptions();
var maxContentHeight = widget.maxContenHeight != null
? widget.maxContenHeight!
var maxContentHeight = widget.maxContentHeight != null
? widget.maxContentHeight!
: directionListenable.value == TDDropdownMenuDirection.auto
? double.infinity
: max<double>(popupState.maxContentHeight - TDDropdownItem.operateHeight, 0);
return Column(
children: [
ConstrainedBox(
constraints: BoxConstraints(minHeight: widget.minContenHeight ?? 0.0, maxHeight: maxContentHeight),
constraints: BoxConstraints(minHeight: widget.minContentHeight ?? 0.0, maxHeight: maxContentHeight),
child: SingleChildScrollView(
child: Column(
children: List.generate(groupCunck.length, (index) {
Expand Down Expand Up @@ -197,11 +197,11 @@ class _TDDropdownItemState extends State<TDDropdownItem> {
),
),
);
return widget.minContenHeight != null || widget.maxContenHeight != null
return widget.minContentHeight != null || widget.maxContentHeight != null
? ConstrainedBox(
constraints: BoxConstraints(
minHeight: widget.minContenHeight ?? 0.0, maxHeight: widget.maxContenHeight ?? double.infinity),
child: widget.maxContenHeight != null ? SingleChildScrollView(child: radios) : radios,
minHeight: widget.minContentHeight ?? 0.0, maxHeight: widget.maxContentHeight ?? double.infinity),
child: widget.maxContentHeight != null ? SingleChildScrollView(child: radios) : radios,
)
: radios;
}
Expand Down
12 changes: 6 additions & 6 deletions tdesign-component/lib/src/components/stepper/td_stepper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ class TDStepper extends StatefulWidget {
class _TDStepperState extends State<TDStepper> {
late int value;
late TextEditingController _controller;
final FocusNode _focuseNode = FocusNode();
final FocusNode _focusNode = FocusNode();

@override
void initState() {
super.initState();
value = widget.value ?? widget.defaultValue ?? 0;
_controller = TextEditingController(text: value.toString());
_focuseNode.addListener(() {
if (!_focuseNode.hasFocus) {
_focusNode.addListener(() {
if (!_focusNode.hasFocus) {
if (widget.onBlur != null) {
widget.onBlur!();
}
Expand All @@ -96,7 +96,7 @@ class _TDStepperState extends State<TDStepper> {
@override
void dispose() {
_controller.dispose();
_focuseNode.dispose();
_focusNode.dispose();
super.dispose();
}

Expand Down Expand Up @@ -218,7 +218,7 @@ class _TDStepperState extends State<TDStepper> {
affinity: TextAffinity.downstream,
offset: value.toString().length,
)));
_focuseNode.unfocus();
_focusNode.unfocus();

if (widget.onChange != null) {
widget.onChange!(value);
Expand Down Expand Up @@ -265,7 +265,7 @@ class _TDStepperState extends State<TDStepper> {
child: TextField(
controller: _controller,
enabled: !widget.disabled && !widget.disableInput,
focusNode: _focuseNode,
focusNode: _focusNode,
style: TextStyle(
fontSize: _getFontSize(),
color: widget.disabled
Expand Down
Loading