Skip to content

feat(hz): add append_direction into update_behavior#1071

Open
gradetwo22 wants to merge 3 commits into
cloudwego:developfrom
gradetwo22:feat_pkgtpl
Open

feat(hz): add append_direction into update_behavior#1071
gradetwo22 wants to merge 3 commits into
cloudwego:developfrom
gradetwo22:feat_pkgtpl

Conversation

@gradetwo22

@gradetwo22 gradetwo22 commented Feb 27, 2024

Copy link
Copy Markdown

What type of PR is this?

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

添加append_direction选项到update_behavior

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en: Add the append_direction option to update_behavior, which controls the position of newly added content relative to the insertion point (before - in front of the insertion point; after - behind the insertion point); default: after.
zh(optional): 添加append_direction选项到update_behavior中,用于控制新增内容追加到插入点的位置(before-在插入点前面;after-在插入点后面;),默认:after

(Optional) Which issue(s) this PR fixes:

(Optional) The PR that updates user documentation:

@gradetwo22 gradetwo22 requested review from a team as code owners February 27, 2024 06:51
@CLAassistant

CLAassistant commented Feb 27, 2024

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ Kevinyyz
❌ kevinzhang


kevinzhang seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@FGYFFFF

FGYFFFF commented Feb 29, 2024

Copy link
Copy Markdown
Contributor

感谢 pr,整体没啥问题,先签一个 CLA 吧~

@gradetwo22

Copy link
Copy Markdown
Author

感谢 pr,整体没啥问题,先签一个 CLA 吧~

签好了~
image

@welkeyever welkeyever changed the title feat: add append_direction into update_behavior feat(hz): add append_direction into update_behavior Mar 5, 2024
Comment thread cmd/hz/generator/custom_files.go Outdated
}
buf := bytes.NewBuffer(nil)
err = writeBytes(buf, part[0], []byte(tplInfo.UpdateBehavior.AppendLocation), appendContent, part[1])
if tplInfo.UpdateBehavior.AppendDirection == "before" {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

可以把 "before" 和 "after" 单独提出来成一个 const 吗? 整体来说没啥问题

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

已修改,麻烦查看一下~

@codecov

codecov Bot commented Mar 20, 2024

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.82%. Comparing base (b7cbc9d) to head (1cc97a5).
⚠️ Report is 178 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1071      +/-   ##
===========================================
+ Coverage    82.79%   82.82%   +0.02%     
===========================================
  Files           98       98              
  Lines        10032    10032              
===========================================
+ Hits          8306     8309       +3     
+ Misses        1236     1233       -3     
  Partials       490      490              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants