-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[CodeStyle] fix renamed files not being monitored by Codestyle Check #48892
Merged
luotao1
merged 11 commits into
PaddlePaddle:develop
from
cattidea:ci-codestyle-not-working
Dec 9, 2022
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
087da0d
add a blank line, test=document_fix
SigureMo 26486c4
move file, test=document_fix
SigureMo c6c1428
Merge branch 'develop' into ci-codestyle-not-working
SigureMo 2c380eb
update the diff_files calculate method
SigureMo b1129f7
empty commit, test=document_fix
SigureMo da8dedf
test `add`, `rename` and `delete`
SigureMo b47e810
empty commit, test=document_fix
SigureMo 3776c79
Revert "add a blank line, test=document_fix"
SigureMo b46d446
Revert "move file, test=document_fix"
SigureMo edc7aa0
Revert "test `add`, `rename` and `delete`"
SigureMo b265fa2
empty commit, test=document_fix
SigureMo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
当前的 diff 文件是通过先
git diff --numstat
再经过awk
处理得到的这样对于大多数文件是没问题的,但对于 rename 文件是有问题的,因为
git diff --numstat
结果像这样:这样
fft.py
通过 awk 计算的路径是正确的,而 rename 的hub.py
则会计算出错误的路径为了避免这样的问题,调整了参数,直接得到需要的文件名
> git diff --name-only --cached --diff-filter=ACMR python/paddle/fft.py python/paddle/hubx.py
这里
--diff-filter ACMR
分别代表 Added (A)、Copied (C)、Modified (M)、Renamed (R) 1Footnotes
--diff-filter
-- git-diff docs ↩