Skip to content

Commit b8b1899

Browse files
authored
Merge branch 'main' into feature/ut-refactor
2 parents 5371361 + 945b543 commit b8b1899

8 files changed

Lines changed: 44 additions & 40 deletions

File tree

.github/workflows/ci-docs.yml

Lines changed: 12 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -21,56 +21,25 @@ on:
2121
pull_request:
2222
paths:
2323
- 'website/**'
24-
- '**/*.md'
2524

2625
jobs:
27-
lint-and-build:
26+
build-and-lint:
2827
runs-on: ubuntu-latest
2928
steps:
3029
- name: Checkout code
3130
uses: actions/checkout@v5
3231

33-
- name: Setup Node.js
34-
uses: actions/setup-node@v4
35-
with:
36-
node-version: '20'
37-
38-
- name: Install markdownlint-cli2
39-
run: npm install -g markdownlint-cli2
40-
41-
- name: Run markdownlint
42-
id: lint
43-
run: |
44-
if [ "${{ github.event_name }}" = "pull_request" ]; then
45-
CHANGED_MD=$(git diff --name-only origin/${{ github.event.pull_request.base.ref }}...${{ github.event.pull_request.head.ref }} | grep -E '\.md$' || true)
46-
else
47-
CHANGED_MD=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | grep -E '\.md$' || true)
48-
fi
49-
if [ -n "$CHANGED_MD" ]; then
50-
markdownlint-cli2 "$CHANGED_MD" --config website/.markdownlint-cli2.jsonc > lint-result.txt || true
51-
if [ -s lint-result.txt ]; then
52-
echo "Lint failed."
53-
# Output non-compliant file contents to comment-body.txt
54-
for file in $CHANGED_MD; do
55-
echo "\n---\n**$file Content:**\n" >> comment-body.txt
56-
echo '\n```markdown' >> comment-body.txt
57-
cat "$file" >> comment-body.txt
58-
echo '\n```' >> comment-body.txt
59-
done
60-
echo "\n---\n**Lint Results:**\n" >> comment-body.txt
61-
cat lint-result.txt >> comment-body.txt
62-
exit 1
63-
fi
64-
else
65-
echo "No markdown files changed, skipping lint."
66-
fi
67-
6832
- name: Setup pnpm
6933
uses: pnpm/action-setup@v4
7034
with:
7135
version: 8
7236
run_install: false
7337

38+
- name: Setup Node.js
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: '20'
42+
7443
- name: Enable corepack
7544
working-directory: website
7645
run: npm i -g --force corepack && corepack enable
@@ -82,3 +51,9 @@ jobs:
8251
- name: Build website
8352
working-directory: website
8453
run: pnpm build
54+
55+
- name: Lint markdown files
56+
uses: DavidAnson/markdownlint-cli2-action@992badcdf24e3b8eb7e87ff9287fe931bcb00c6e
57+
with:
58+
globs: 'website/**/*.md'
59+
config: 'website/.markdownlint-cli2.jsonc'

fesod/src/main/java/org/apache/fesod/sheet/metadata/csv/CsvCellStyle.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,20 @@
1919

2020
package org.apache.fesod.sheet.metadata.csv;
2121

22+
import java.util.EnumMap;
2223
import lombok.EqualsAndHashCode;
2324
import lombok.Getter;
2425
import lombok.Setter;
2526
import org.apache.fesod.sheet.metadata.data.DataFormatData;
2627
import org.apache.poi.ss.usermodel.BorderStyle;
28+
import org.apache.poi.ss.usermodel.CellPropertyType;
2729
import org.apache.poi.ss.usermodel.CellStyle;
2830
import org.apache.poi.ss.usermodel.Color;
2931
import org.apache.poi.ss.usermodel.FillPatternType;
3032
import org.apache.poi.ss.usermodel.Font;
3133
import org.apache.poi.ss.usermodel.HorizontalAlignment;
3234
import org.apache.poi.ss.usermodel.VerticalAlignment;
35+
import org.apache.poi.ss.util.CellUtil;
3336

3437
/**
3538
* csv cell style
@@ -279,4 +282,12 @@ public void setShrinkToFit(boolean shrinkToFit) {}
279282
public boolean getShrinkToFit() {
280283
return false;
281284
}
285+
286+
@Override
287+
public EnumMap<CellPropertyType, Object> getFormatProperties() {
288+
return CellUtil.getFormatProperties(this);
289+
}
290+
291+
@Override
292+
public void invalidateCachedProperties() {}
282293
}

fesod/src/main/java/org/apache/fesod/sheet/write/metadata/fill/AnalysisCell.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
package org.apache.fesod.sheet.write.metadata.fill;
2121

2222
import java.util.List;
23-
import lombok.EqualsAndHashCode;
2423
import lombok.Getter;
2524
import lombok.Setter;
2625
import org.apache.fesod.sheet.enums.WriteTemplateAnalysisCellTypeEnum;
@@ -32,7 +31,6 @@
3231
**/
3332
@Getter
3433
@Setter
35-
@EqualsAndHashCode
3634
public class AnalysisCell {
3735
private int columnIndex;
3836
private int rowIndex;

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<maven.javadoc.skip>true</maven.javadoc.skip>
5454
<maven.test.skip>true</maven.test.skip>
5555
<commons-csv.version>1.11.0</commons-csv.version>
56-
<poi.version>5.4.1</poi.version>
56+
<poi.version>5.5.1</poi.version>
5757
<ehcache.version>3.9.11</ehcache.version>
5858
<commons-io.version>2.16.1</commons-io.version>
5959
<slf4j-api.version>1.7.36</slf4j-api.version>

website/docs/migration/from-fastexcel.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Replace your existing dependency with Apache Fesod (Incubating):
4444
| **Apache Fesod (Incubating)**| org.apache.fesod | fesod | 1.3.0+ |
4545

4646
**Maven:**
47+
4748
```xml
4849
<dependency>
4950
<groupId>org.apache.fesod</groupId>
@@ -53,6 +54,7 @@ Replace your existing dependency with Apache Fesod (Incubating):
5354
```
5455

5556
**Gradle:**
57+
5658
```gradle
5759
implementation 'org.apache.fesod:fesod:1.3.0'
5860
```
@@ -101,23 +103,27 @@ Replace deprecated entry point classes with FesodSheet.
101103
Utilize the deprecated alias classes for a phased migration approach.
102104

103105
**Phase 1: Dependency Update Only**
106+
104107
- Update Maven/Gradle dependency to Apache Fesod (Incubating)
105108
- Keep using FastExcel classes (now deprecated aliases)
106109
- Update package imports only
107110
- Run comprehensive tests to verify compatibility
108111

109112
**Phase 2: Class Name Migration**
113+
110114
- Progressively replace deprecated classes with FesodSheet
111115
- Use IDE refactoring tools for bulk renaming
112116
- Migrate module by module or feature by feature
113117
- Maintain thorough test coverage throughout
114118

115119
**Phase 3: Cleanup**
120+
116121
- Remove all references to deprecated classes
117122
- Resolve deprecation warnings
118123
- Update documentation and code comments
119124

120125
**Benefits:**
126+
121127
- Lower risk through incremental changes
122128
- Easier rollback if issues arise
123129
- Minimal disruption to ongoing development

website/i18n/en/docusaurus-plugin-content-docs/current.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,9 @@
2626
"sidebar.docs.category.fesod-sheet": {
2727
"message": "Fesod Sheet",
2828
"description": "The label for category fesod-sheet in sidebar docs"
29+
},
30+
"sidebar.docs.category.migration": {
31+
"message": "Migration",
32+
"description": "The label for category migration in sidebar docs"
2933
}
3034
}

website/i18n/zh-cn/docusaurus-plugin-content-docs/current.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,9 @@
2626
"sidebar.docs.category.fesod-sheet": {
2727
"message": "Fesod Sheet",
2828
"description": "The label for category fesod-sheet in sidebar docs"
29+
},
30+
"sidebar.docs.category.migration": {
31+
"message": "迁移",
32+
"description": "The label for category migration in sidebar docs"
2933
}
3034
}

website/i18n/zh-cn/docusaurus-plugin-content-docs/current/migration/from-fastexcel.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ keywords: [fesod, 迁移, fastexcel, apache, excel, 升级]
4444
| **Apache Fesod (Incubating)**| org.apache.fesod | fesod | 1.3.0+ |
4545

4646
**Maven 配置:**
47+
4748
```xml
4849
<dependency>
4950
<groupId>org.apache.fesod</groupId>
@@ -53,6 +54,7 @@ keywords: [fesod, 迁移, fastexcel, apache, excel, 升级]
5354
```
5455

5556
**Gradle 配置:**
57+
5658
```gradle
5759
implementation 'org.apache.fesod:fesod:1.3.0'
5860
```
@@ -101,23 +103,27 @@ implementation 'org.apache.fesod:fesod:1.3.0'
101103
利用已废弃的别名类进行分阶段迁移。
102104

103105
**阶段 1: 仅更新依赖**
106+
104107
- 将 Maven/Gradle 依赖更新为 Apache Fesod (Incubating)
105108
- 继续使用 FastExcel 类(现为已废弃的别名)
106109
- 仅更新包导入
107110
- 运行全面测试以验证兼容性
108111

109112
**阶段 2: 类名迁移**
113+
110114
- 逐步将已废弃的类替换为 FesodSheet
111115
- 使用 IDE 重构工具进行批量重命名
112116
- 逐个模块或逐个功能进行迁移
113117
- 在整个过程中保持全面的测试覆盖
114118

115119
**阶段 3: 清理**
120+
116121
- 删除所有对已废弃类的引用
117122
- 解决废弃警告
118123
- 更新文档和代码注释
119124

120125
**优势:**
126+
121127
- 通过增量更改降低风险
122128
- 如果出现问题更容易回滚
123129
- 对正在进行的开发影响最小

0 commit comments

Comments
 (0)