You've already forked v8-code-style
mirror of
https://github.com/1C-Company/v8-code-style.git
synced 2025-07-17 21:17:41 +02:00
Merge pull request #1396 from 1C-Company/bugfix/1207-accessibility-at-client-with-pragma
Ложное срабатывание проверки в модулях расширений: 456 #1207
This commit is contained in:
@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
### Исправленные ошибки
|
### Исправленные ошибки
|
||||||
|
|
||||||
|
- Ложное срабатывание проверки module-accessibility-at-client в модулях расширений #1207
|
||||||
|
|
||||||
|
|
||||||
## 0.6.0
|
## 0.6.0
|
||||||
|
@ -164,7 +164,7 @@ public class AccessibilityAtClientInObjectModuleCheck
|
|||||||
private boolean allowManagerEventAtClient(EObject object, Module module, ICheckParameters parameters)
|
private boolean allowManagerEventAtClient(EObject object, Module module, ICheckParameters parameters)
|
||||||
{
|
{
|
||||||
if (object instanceof Method && module.getModuleType() == ModuleType.MANAGER_MODULE
|
if (object instanceof Method && module.getModuleType() == ModuleType.MANAGER_MODULE
|
||||||
&& ((Method)object).isEvent())
|
&& (((Method)object).isEvent() || !((Method)object).getPragmas().isEmpty()))
|
||||||
{
|
{
|
||||||
String parameterMethodNames = parameters.getString(PARAMETER_ALLOW_MANAGER_EVENTS_AT_CLIENT);
|
String parameterMethodNames = parameters.getString(PARAMETER_ALLOW_MANAGER_EVENTS_AT_CLIENT);
|
||||||
if (StringUtils.isEmpty(parameterMethodNames))
|
if (StringUtils.isEmpty(parameterMethodNames))
|
||||||
@ -175,8 +175,11 @@ public class AccessibilityAtClientInObjectModuleCheck
|
|||||||
Method method = (Method)object;
|
Method method = (Method)object;
|
||||||
Set<String> methodNames = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
|
Set<String> methodNames = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
|
||||||
methodNames.addAll(List.of(parameterMethodNames.split(",\\s*"))); //$NON-NLS-1$
|
methodNames.addAll(List.of(parameterMethodNames.split(",\\s*"))); //$NON-NLS-1$
|
||||||
return methodNames.contains(method.getName());
|
return methodNames.contains(method.getName()) || !method.getPragmas().isEmpty() && method.getPragmas()
|
||||||
|
.stream()
|
||||||
|
.map(p -> p.getValue().replace("\"", "")) //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
.filter(StringUtils::isNotBlank)
|
||||||
|
.anyMatch(methodNames::contains);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ public class AccessibilityAtClientInObjectModuleCheckTest
|
|||||||
Marker marker = markers.get(0);
|
Marker marker = markers.get(0);
|
||||||
assertEquals("2", marker.getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY));
|
assertEquals("2", marker.getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY));
|
||||||
marker = markers.get(1);
|
marker = markers.get(1);
|
||||||
assertEquals("22", marker.getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY));
|
assertEquals("27", marker.getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY));
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Marker> getObjectModuleMarkers()
|
private List<Marker> getObjectModuleMarkers()
|
||||||
|
@ -19,6 +19,11 @@ Procedure PresentationFieldsGetProcessing(Fields, StandardProcessing)
|
|||||||
// Complaint
|
// Complaint
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
|
&After("PresentationFieldsGetProcessing")
|
||||||
|
Procedure Compiant2(Fields, StandardProcessing)
|
||||||
|
// Complaint
|
||||||
|
EndProcedure
|
||||||
|
|
||||||
Procedure Noncompiant2() Export
|
Procedure Noncompiant2() Export
|
||||||
// empty
|
// empty
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
Reference in New Issue
Block a user