mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
migrator: ignore migration scripts with underscored new names. rdar://39877447
Updating something to underscored names is hardly correct. This patch disallows picking up such migration scripts.
This commit is contained in:
@@ -3989,12 +3989,7 @@ static int deserializeNameCorrection(APIDiffItemStore &Store,
|
||||
if (CI->DiffKind == NodeAnnotation::Rename) {
|
||||
auto NewName = CI->getNewName();
|
||||
auto Module = CI->ModuleName;
|
||||
DeclNameViewer Viewer(NewName);
|
||||
auto HasUnderScore =
|
||||
[](StringRef S) { return S.find('_') != StringRef::npos; };
|
||||
auto Args = Viewer.args();
|
||||
if (HasUnderScore(Viewer.base()) ||
|
||||
std::any_of(Args.begin(), Args.end(), HasUnderScore)) {
|
||||
if (CI->rightCommentUnderscored()) {
|
||||
Result.insert(NameCorrectionInfo(NewName, NewName, Module));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user