Skip to content

Commit 964016c

Browse files
Refactor naming of sanitize levels
Updating the names to more commonly used terms that reflect the intended usage. "Aggressive" implies an extra-strong level, rather than what is actually the normal, standard level that should be used for most projects. Hopefully this will make the levels more clear for new users to understand.
1 parent 3c1e0d4 commit 964016c

File tree

4 files changed

+23
-26
lines changed

4 files changed

+23
-26
lines changed

Version Control.accda.src/modules/clsOptions.cls

+6-6
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ Public Sub LoadDefaults()
7979
.ForceImportOriginalQuerySQL = False
8080
.SaveTableSQL = True
8181
.StripPublishOption = True
82-
.SanitizeLevel = eslAggressive
83-
.SanitizeColors = eslBasic
82+
.SanitizeLevel = eslStandard
83+
.SanitizeColors = eslMinimal
8484
.ShowVCSLegacy = True
8585
.HashAlgorithm = DefaultHashAlgorithm
8686
.UseShortHash = True
@@ -280,7 +280,7 @@ Private Sub Upgrade(ByRef dOptions As Dictionary)
280280
' Check for non-default level
281281
If Not dOptions("AggressiveSanitize") Then
282282
' Set to basic level
283-
dOptions.Add "SanitizeLevel", eslBasic
283+
dOptions.Add "SanitizeLevel", eslMinimal
284284
End If
285285
End If
286286
End If
@@ -476,9 +476,9 @@ End Function
476476
Public Function GetSanitizeLevelName(intSanitizeLevel As eSanitizeLevel) As String
477477
Select Case intSanitizeLevel
478478
Case eslNone: GetSanitizeLevelName = "None (Off)"
479-
Case eslBasic: GetSanitizeLevelName = "Basic"
480-
Case eslAggressive: GetSanitizeLevelName = "Aggressive"
481-
Case eslAdvancedBeta: GetSanitizeLevelName = "Advanced (BETA)"
479+
Case eslMinimal: GetSanitizeLevelName = "Minimal"
480+
Case eslStandard: GetSanitizeLevelName = "Standard"
481+
Case eslExtended: GetSanitizeLevelName = "Extended"
482482
Case Else: GetSanitizeLevelName = vbNullString
483483
End Select
484484
End Function

Version Control.accda.src/modules/modAPI.bas

+6-9
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,13 @@ Public Enum eTableDataExportFormat
2525
[_Last] = 2
2626
End Enum
2727

28+
' Sanitize levels used for sanitizing general and color elements in source files.
2829
Public Enum eSanitizeLevel
29-
eslNone = 0 ' Sanitize only items which won't build correctly unless you sanitize them.
30-
eslBasic ' Strip out excess items (like GUIDs) that are just noise and no effect can be found.
31-
eslAggressive ' Strip out anything that can be reliably rebuilt by Access during Build (themed control colors).
32-
33-
' WARNING: AdvancedBeta introduces sanitzation that may or may not work in all environments, and has known
34-
' (or highly suspected) edge cases where it does not always operate correctly. Do not use this level in
35-
' production databases.
36-
eslAdvancedBeta ' Remove all excess noise. Try out new sanitize features that still have ragged edges.
37-
[_Last] ' DO NOT REMOVE: This is a "Fake" level, and must be at the end.
30+
eslNone = 0 ' Don't sanitize anything.
31+
eslMinimal ' Sanitize minimal things like GUIDs.
32+
eslStandard ' Remove non-critical elements that cause VCS noise between builds.
33+
eslExtended ' Remove as much as possible. May have possible negative effects.
34+
[_Last] ' Placeholder for the end of the list.
3835
End Enum
3936

4037

Version Control.accda.src/modules/modConnect.bas

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Public Function SanitizeConnectionString(strConnection As String) As String
4444
StartsWith(strPart, "PWD=", vbTextCompare)
4545
' These values are not needed when using a trusted connection.
4646
If (InStr(1, strConnection, "Trusted_Connection=Yes", vbTextCompare) = 0) _
47-
Or (Options.SanitizeLevel < eslAggressive) Then
47+
Or (Options.SanitizeLevel < eslStandard) Then
4848
' Retain the values if not using trusted connection, or if
4949
' using less than the normal sanitize level.
5050
.Add strPart

Version Control.accda.src/modules/modSanitize.bas

+10-10
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Public Function SanitizeFile(strPath As String, blnReturnHash As Boolean) As Str
116116
"NameMap = Begin", _
117117
"dbLongBinary ""DOL"" = Begin", _
118118
"dbBinary ""GUID"" = Begin"
119-
If Options.SanitizeLevel >= eslAggressive Then
119+
If Options.SanitizeLevel >= eslStandard Then
120120
blnInsideIgnoredBlock = True
121121
SkipLine lngLine
122122
End If
@@ -154,7 +154,7 @@ Public Function SanitizeFile(strPath As String, blnReturnHash As Boolean) As Str
154154
If blnIsPassThroughQuery Then
155155
' Ignore remaining content. (See Issue #182)
156156
Do While lngLine < UBound(varLines)
157-
SkipLine lngLine, eslAggressive
157+
SkipLine lngLine, eslStandard
158158
lngLine = lngLine + 1
159159
Loop
160160
Exit Do
@@ -175,7 +175,7 @@ Public Function SanitizeFile(strPath As String, blnReturnHash As Boolean) As Str
175175
SkipLine lngLine
176176
ElseIf StartsWith(strTLine, "Checksum =") Then
177177
' Ignore Checksum lines, since they will change.
178-
SkipLine lngLine, eslBasic
178+
SkipLine lngLine, eslMinimal
179179
ElseIf StartsWith(strTLine, "ColumnInfo =") _
180180
Or StartsWith(strTLine, "BaseInfo =") Then
181181
' [ColumnInfo] contains some cached info from the record source
@@ -184,24 +184,24 @@ Public Function SanitizeFile(strPath As String, blnReturnHash As Boolean) As Str
184184
' Since the value could span multiple lines, we need to
185185
' check the indent level of the following lines to see how
186186
' many lines to skip.
187-
SkipLine lngLine, eslAggressive
187+
SkipLine lngLine, eslStandard
188188
intIndent = GetIndent(strLine)
189189
' Preview the next line, and check the indent level
190190
Do While GetIndent(varLines(lngLine + 1)) > intIndent
191191
' Skip previewed line and move to next line
192-
SkipLine lngLine + 1, eslAggressive
192+
SkipLine lngLine + 1, eslStandard
193193
lngLine = lngLine + 1
194194
Loop
195195
ElseIf blnIsReport And StartsWith(strLine, " Right =") Then
196196
' Ignore this line. (Not important, and frequently changes.)
197-
SkipLine lngLine, eslAggressive
197+
SkipLine lngLine, eslStandard
198198
ElseIf blnIsReport And StartsWith(strLine, " Bottom =") Then
199199
' Turn flag back off now that we have ignored these two lines.
200-
SkipLine lngLine, eslAggressive
200+
SkipLine lngLine, eslStandard
201201
blnIsReport = False
202202
ElseIf StartsWith(strTLine, "WebImagePadding") Then
203203
' These values tend to drift between builds. See #423
204-
SkipLine lngLine, eslAggressive
204+
SkipLine lngLine, eslStandard
205205
ElseIf StartsWith(strTLine, "Begin ") Then
206206
' Include block type name for controls
207207
BeginBlock Mid$(strTLine, 7)
@@ -425,7 +425,7 @@ Private Sub CloseBlock()
425425
' unless otherwise specified.
426426
' As discussed in #183, this can be affected by incomplete
427427
' component definition blocks.
428-
If Options.SanitizeColors = eslAdvancedBeta Then
428+
If Options.SanitizeColors = eslExtended Then
429429
strKey = varBase(intCnt) & "Color"
430430
If dBlock.Exists(strKey) Then
431431
' Skip the dynamic color line
@@ -531,7 +531,7 @@ Public Function SanitizeVBA(strCode As String) As String
531531
Dim lngLastLine As Long
532532

533533
' Skip sanitizing if not using that option.
534-
If Options.SanitizeLevel < eslAggressive Then
534+
If Options.SanitizeLevel < eslStandard Then
535535
SanitizeVBA = strCode
536536
Exit Function
537537
End If

0 commit comments

Comments
 (0)