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(hz): add append_direction into update_behavior #1071

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Kevinyyz
Copy link

@Kevinyyz Kevinyyz commented Feb 27, 2024

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:

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

CLAassistant commented Feb 27, 2024

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
Copy link
Contributor

FGYFFFF commented Feb 29, 2024

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

@Kevinyyz
Copy link
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
@@ -555,7 +559,11 @@ func (pkgGen *HttpPackageGenerator) genSingleCustomizedFile(tplInfo *Template, f
return fmt.Errorf("do not support multiple append location '%s' for file '%s'\n", tplInfo.UpdateBehavior.AppendLocation, filePath)
}
buf := bytes.NewBuffer(nil)
err = writeBytes(buf, part[0], []byte(tplInfo.UpdateBehavior.AppendLocation), appendContent, part[1])
if tplInfo.UpdateBehavior.AppendDirection == "before" {
Copy link
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
Author

Choose a reason for hiding this comment

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

已修改,麻烦查看一下~

Copy link

codecov bot commented Mar 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.82%. Comparing base (b7cbc9d) to head (1cc97a5).

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 Sentry.
📢 Have feedback on the report? Share it here.

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.

None yet

3 participants