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:
commit
1074474016
@ -38,6 +38,7 @@
|
||||
### Исправленные ошибки
|
||||
|
||||
- Требование к программному продукту: Для переменных общих модулей проверялся префикс расширения и диагностировалась ошибка
|
||||
- При анализе расположения устаревших методов учитывался только сценарий расположения устаревшей области в программном интерфейса, теперь учитывается еще и служебный программный интерфейс
|
||||
|
||||
## 0.4.0
|
||||
|
||||
|
@ -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)));
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,14 @@
|
||||
#Region Internal
|
||||
|
||||
#Region Deprecated
|
||||
|
||||
// Deprecated. Instead, use SupportedProcedure
|
||||
Procedure DeprecatedProcedure() Export
|
||||
|
||||
DeprecatedProcedure()
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
#EndRegion
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user