mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 04:00:04 +00:00 
			
		
		
		
	NOLINT setting settings defaults/minimums/maximums for magic numbers
This commit is contained in:
		
							parent
							
								
									c1aeefb0eb
								
							
						
					
					
						commit
						0a3913bdee
					
				
					 7 changed files with 24 additions and 1 deletions
				
			
		|  | @ -33,6 +33,8 @@ public: | ||||||
| 
 | 
 | ||||||
|       boost::to_lower(defaultAlertLocationMethodValue); |       boost::to_lower(defaultAlertLocationMethodValue); | ||||||
| 
 | 
 | ||||||
|  |       // SetDefault, SetMinimum and SetMaximum are descriptive
 | ||||||
|  |       // NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers)
 | ||||||
|       alertSoundFile_.SetDefault(defaultAlertSoundFileValue); |       alertSoundFile_.SetDefault(defaultAlertSoundFileValue); | ||||||
|       alertLocationMethod_.SetDefault(defaultAlertLocationMethodValue); |       alertLocationMethod_.SetDefault(defaultAlertLocationMethodValue); | ||||||
|       alertLatitude_.SetDefault(0.0); |       alertLatitude_.SetDefault(0.0); | ||||||
|  | @ -48,7 +50,7 @@ public: | ||||||
|       alertLongitude_.SetMaximum(180.0); |       alertLongitude_.SetMaximum(180.0); | ||||||
|       alertRadius_.SetMinimum(0.0); |       alertRadius_.SetMinimum(0.0); | ||||||
|       alertRadius_.SetMaximum(9999999999); |       alertRadius_.SetMaximum(9999999999); | ||||||
| 
 |       // NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
 | ||||||
| 
 | 
 | ||||||
|       alertLocationMethod_.SetValidator( |       alertLocationMethod_.SetValidator( | ||||||
|          SCWX_SETTINGS_ENUM_VALIDATOR(types::LocationMethod, |          SCWX_SETTINGS_ENUM_VALIDATOR(types::LocationMethod, | ||||||
|  |  | ||||||
|  | @ -50,6 +50,8 @@ public: | ||||||
|       boost::to_lower(defaultPositioningPlugin); |       boost::to_lower(defaultPositioningPlugin); | ||||||
|       boost::to_lower(defaultThemeValue); |       boost::to_lower(defaultThemeValue); | ||||||
| 
 | 
 | ||||||
|  |       // SetDefault, SetMinimum, and SetMaximum are descriptive
 | ||||||
|  |       // NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers)
 | ||||||
|       antiAliasingEnabled_.SetDefault(true); |       antiAliasingEnabled_.SetDefault(true); | ||||||
|       clockFormat_.SetDefault(defaultClockFormatValue); |       clockFormat_.SetDefault(defaultClockFormatValue); | ||||||
|       customStyleDrawLayer_.SetDefault(".*\\.annotations\\.points"); |       customStyleDrawLayer_.SetDefault(".*\\.annotations\\.points"); | ||||||
|  | @ -100,6 +102,7 @@ public: | ||||||
|       nmeaBaudRate_.SetMaximum(999999999); |       nmeaBaudRate_.SetMaximum(999999999); | ||||||
|       radarSiteThreshold_.SetMinimum(-10000); |       radarSiteThreshold_.SetMinimum(-10000); | ||||||
|       radarSiteThreshold_.SetMaximum(10000); |       radarSiteThreshold_.SetMaximum(10000); | ||||||
|  |       // NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
 | ||||||
| 
 | 
 | ||||||
|       customStyleDrawLayer_.SetTransform([](const std::string& value) |       customStyleDrawLayer_.SetTransform([](const std::string& value) | ||||||
|                                          { return boost::trim_copy(value); }); |                                          { return boost::trim_copy(value); }); | ||||||
|  |  | ||||||
|  | @ -27,6 +27,8 @@ class LineSettings::Impl | ||||||
| public: | public: | ||||||
|    explicit Impl() |    explicit Impl() | ||||||
|    { |    { | ||||||
|  |       // SetDefault, SetMinimum, and SetMaximum are descriptive
 | ||||||
|  |       // NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers)
 | ||||||
|       lineColor_.SetDefault(kWhiteColorString_); |       lineColor_.SetDefault(kWhiteColorString_); | ||||||
|       highlightColor_.SetDefault(kTransparentColorString_); |       highlightColor_.SetDefault(kTransparentColorString_); | ||||||
|       borderColor_.SetDefault(kBlackColorString_); |       borderColor_.SetDefault(kBlackColorString_); | ||||||
|  | @ -42,6 +44,7 @@ public: | ||||||
|       lineWidth_.SetMaximum(9); |       lineWidth_.SetMaximum(9); | ||||||
|       highlightWidth_.SetMaximum(9); |       highlightWidth_.SetMaximum(9); | ||||||
|       borderWidth_.SetMaximum(9); |       borderWidth_.SetMaximum(9); | ||||||
|  |       // NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
 | ||||||
| 
 | 
 | ||||||
|       lineColor_.SetValidator(&util::color::ValidateArgbString); |       lineColor_.SetValidator(&util::color::ValidateArgbString); | ||||||
|       highlightColor_.SetValidator(&util::color::ValidateArgbString); |       highlightColor_.SetValidator(&util::color::ValidateArgbString); | ||||||
|  |  | ||||||
|  | @ -15,9 +15,12 @@ class ProductSettings::Impl | ||||||
| public: | public: | ||||||
|    explicit Impl() |    explicit Impl() | ||||||
|    { |    { | ||||||
|  |       // SetDefault, SetMinimum and SetMaximum are descriptive
 | ||||||
|  |       // NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers)
 | ||||||
|       showSmoothedRangeFolding_.SetDefault(false); |       showSmoothedRangeFolding_.SetDefault(false); | ||||||
|       stiForecastEnabled_.SetDefault(true); |       stiForecastEnabled_.SetDefault(true); | ||||||
|       stiPastEnabled_.SetDefault(true); |       stiPastEnabled_.SetDefault(true); | ||||||
|  |       // NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
 | ||||||
|    } |    } | ||||||
| 
 | 
 | ||||||
|    ~Impl() {} |    ~Impl() {} | ||||||
|  |  | ||||||
|  | @ -50,12 +50,15 @@ public: | ||||||
| 
 | 
 | ||||||
|       boost::to_lower(defaultTooltipMethodValue); |       boost::to_lower(defaultTooltipMethodValue); | ||||||
| 
 | 
 | ||||||
|  |       // SetDefault, SetMinimum and SetMaximum are descriptive
 | ||||||
|  |       // NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers)
 | ||||||
|       hoverTextWrap_.SetDefault(80); |       hoverTextWrap_.SetDefault(80); | ||||||
|       hoverTextWrap_.SetMinimum(0); |       hoverTextWrap_.SetMinimum(0); | ||||||
|       hoverTextWrap_.SetMaximum(999); |       hoverTextWrap_.SetMaximum(999); | ||||||
|       placefileTextDropShadowEnabled_.SetDefault(true); |       placefileTextDropShadowEnabled_.SetDefault(true); | ||||||
|       radarSiteHoverTextEnabled_.SetDefault(true); |       radarSiteHoverTextEnabled_.SetDefault(true); | ||||||
|       tooltipMethod_.SetDefault(defaultTooltipMethodValue); |       tooltipMethod_.SetDefault(defaultTooltipMethodValue); | ||||||
|  |       // NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
 | ||||||
| 
 | 
 | ||||||
|       tooltipMethod_.SetValidator( |       tooltipMethod_.SetValidator( | ||||||
|          [](const std::string& value) |          [](const std::string& value) | ||||||
|  | @ -141,8 +144,11 @@ void TextSettings::Impl::InitializeFontVariables() | ||||||
|                                    { return !value.empty(); }); |                                    { return !value.empty(); }); | ||||||
| 
 | 
 | ||||||
|       // Font point size must be between 6 and 72
 |       // Font point size must be between 6 and 72
 | ||||||
|  |       // SetDefault, SetMinimum and SetMaximum are descriptive
 | ||||||
|  |       // NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers)
 | ||||||
|       font.fontPointSize_.SetMinimum(6.0); |       font.fontPointSize_.SetMinimum(6.0); | ||||||
|       font.fontPointSize_.SetMaximum(72.0); |       font.fontPointSize_.SetMaximum(72.0); | ||||||
|  |       // NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
 | ||||||
| 
 | 
 | ||||||
|       // Variable registration
 |       // Variable registration
 | ||||||
|       auto& settings = fontSettings_.emplace_back( |       auto& settings = fontSettings_.emplace_back( | ||||||
|  |  | ||||||
|  | @ -14,6 +14,8 @@ class UiSettingsImpl | ||||||
| public: | public: | ||||||
|    explicit UiSettingsImpl() |    explicit UiSettingsImpl() | ||||||
|    { |    { | ||||||
|  |       // SetDefault, SetMinimum and SetMaximum are descriptive
 | ||||||
|  |       // NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers)
 | ||||||
|       level2ProductsExpanded_.SetDefault(false); |       level2ProductsExpanded_.SetDefault(false); | ||||||
|       level2SettingsExpanded_.SetDefault(true); |       level2SettingsExpanded_.SetDefault(true); | ||||||
|       level3ProductsExpanded_.SetDefault(true); |       level3ProductsExpanded_.SetDefault(true); | ||||||
|  | @ -21,6 +23,7 @@ public: | ||||||
|       timelineExpanded_.SetDefault(true); |       timelineExpanded_.SetDefault(true); | ||||||
|       mainUIState_.SetDefault(""); |       mainUIState_.SetDefault(""); | ||||||
|       mainUIGeometry_.SetDefault(""); |       mainUIGeometry_.SetDefault(""); | ||||||
|  |       // NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
 | ||||||
|    } |    } | ||||||
| 
 | 
 | ||||||
|    ~UiSettingsImpl() {} |    ~UiSettingsImpl() {} | ||||||
|  |  | ||||||
|  | @ -35,11 +35,14 @@ public: | ||||||
|       boost::to_lower(defaultSpeedUnitsValue); |       boost::to_lower(defaultSpeedUnitsValue); | ||||||
|       boost::to_lower(defaultDistanceUnitsValue); |       boost::to_lower(defaultDistanceUnitsValue); | ||||||
| 
 | 
 | ||||||
|  |       // SetDefault, SetMinimum and SetMaximum are descriptive
 | ||||||
|  |       // NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers)
 | ||||||
|       accumulationUnits_.SetDefault(defaultAccumulationUnitsValue); |       accumulationUnits_.SetDefault(defaultAccumulationUnitsValue); | ||||||
|       echoTopsUnits_.SetDefault(defaultEchoTopsUnitsValue); |       echoTopsUnits_.SetDefault(defaultEchoTopsUnitsValue); | ||||||
|       otherUnits_.SetDefault(defaultOtherUnitsValue); |       otherUnits_.SetDefault(defaultOtherUnitsValue); | ||||||
|       speedUnits_.SetDefault(defaultSpeedUnitsValue); |       speedUnits_.SetDefault(defaultSpeedUnitsValue); | ||||||
|       distanceUnits_.SetDefault(defaultDistanceUnitsValue); |       distanceUnits_.SetDefault(defaultDistanceUnitsValue); | ||||||
|  |       // NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
 | ||||||
| 
 | 
 | ||||||
|       accumulationUnits_.SetValidator( |       accumulationUnits_.SetValidator( | ||||||
|          SCWX_SETTINGS_ENUM_VALIDATOR(types::AccumulationUnits, |          SCWX_SETTINGS_ENUM_VALIDATOR(types::AccumulationUnits, | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 AdenKoperczak
						AdenKoperczak