1
0
mirror of https://github.com/1C-Company/v8-code-style.git synced 2025-02-22 16:25:25 +02:00

Merge pull request #1287 from 1C-Company/bugfix/issue-1281-deprecated

#1281 Исправление ложного срабатывания для устаревших методов
This commit is contained in:
Dmitriy Marmyshev 2023-03-20 02:21:57 -07:00 committed by GitHub
commit 1074474016
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 2 deletions

View File

@ -38,6 +38,7 @@
### Исправленные ошибки
- Требование к программному продукту: Для переменных общих модулей проверялся префикс расширения и диагностировалась ошибка
- При анализе расположения устаревших методов учитывался только сценарий расположения устаревшей области в программном интерфейса, теперь учитывается еще и служебный программный интерфейс
## 0.4.0

View File

@ -125,6 +125,7 @@ public class DeprecatedProcedureOutsideDeprecatedRegionCheck
return false;
}
return regionFirst.get().getName().equals(ModuleStructureSection.DEPRECATED_REGION.getName(scriptVariant))
&& regionTop.get().getName().equals(ModuleStructureSection.PUBLIC.getName(scriptVariant));
&& (regionTop.get().getName().equals(ModuleStructureSection.PUBLIC.getName(scriptVariant))
|| regionTop.get().getName().equals(ModuleStructureSection.INTERNAL.getName(scriptVariant)));
}
}

View File

@ -0,0 +1,14 @@
#Region Internal
#Region Deprecated
// Deprecated. Instead, use SupportedProcedure
Procedure DeprecatedProcedure() Export
DeprecatedProcedure()
EndProcedure
#EndRegion
#EndRegion

View File

@ -55,6 +55,20 @@ public class DeprecatedProcedureOutsideDeprecatedRegionCheckTest
assertTrue(markers.isEmpty());
}
/**
* Test a deprecated method is placed in the Deprecated region of the Internal region in a common module area
*
* @throws Exception the exception
*/
@Test
public void testCompliantDeprecatedMethodInInternal() throws Exception
{
updateModule(FOLDER_RESOURCE + "deprecated-method-compliant2.bsl");
List<Marker> markers = getModuleMarkers();
assertTrue(markers.isEmpty());
}
/**
* Test a deprecated method is placed a nested region in the Deprecated region of the Public region
* in a common module area