您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 

35 行
962 B

  1. $projectRoot = (Resolve-Path (Join-Path $PSScriptRoot '..')).Path
  2. $sourcePaths = @(
  3. (Join-Path $projectRoot 'Core/OS/Cfg/app_cfg.h'),
  4. (Join-Path $projectRoot 'Core/Src/main.c')
  5. )
  6. $forbiddenSymbols = @(
  7. 'APP_MODBUS_REG_OPERATION_RX_COUNT',
  8. 'APP_MODBUS_REG_OPERATION_TX_COUNT',
  9. 'APP_MODBUS_REG_ERROR_COUNT',
  10. 'ModbusOperationRxCount',
  11. 'ModbusOperationTxCount',
  12. 'ModbusProtocolErrorCount',
  13. 'ModbusReceiveErrorCount',
  14. 'ModbusSemaphoreErrorCount',
  15. 'AppUpdateStatusRegisters',
  16. 'AppRecordIsrError'
  17. )
  18. $violations = @()
  19. foreach ($sourcePath in $sourcePaths) {
  20. $source = Get-Content -Raw $sourcePath
  21. foreach ($symbol in $forbiddenSymbols) {
  22. if ($source.Contains($symbol)) {
  23. $violations += "$sourcePath still contains $symbol"
  24. }
  25. }
  26. }
  27. if ($violations.Count -ne 0) {
  28. $violations | ForEach-Object { Write-Error $_ }
  29. exit 1
  30. }
  31. Write-Output 'Communication counter logic is absent.'