Skip to content

Commit 7749ea3

Browse files
authored
Merge pull request #4196 from ruhullahshah/feature/update-blacklist-terminology-to-be-more-inclusive
Update the blacklist terminology to be more inclusive
2 parents 928f287 + 3bd63bf commit 7749ea3

File tree

6 files changed

+31
-31
lines changed

6 files changed

+31
-31
lines changed

src/Paket.Core/Dependencies/NuGetCache.fs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -645,20 +645,20 @@ type UrlToTry =
645645
type BlockedCacheEntry =
646646
{ BlockedFormats : string list }
647647

648-
let private tryUrlOrBlacklistI =
649-
let tryUrlOrBlacklistInner (f : unit -> Async<obj>, isOk : obj -> bool) cacheKey =
648+
let private tryUrlOrIgnoreI =
649+
let tryUrlOrIgnoreInner (f : unit -> Async<obj>, isOk : obj -> bool) cacheKey =
650650
async {
651651
//try
652652
let! res = f ()
653653
return isOk res, res
654654
}
655-
let memoizedBlackList = memoizeAsyncEx tryUrlOrBlacklistInner
655+
let memoizedIgnoreList = memoizeAsyncEx tryUrlOrIgnoreInner
656656
fun f isOk cacheKey ->
657-
memoizedBlackList (f, isOk) cacheKey
657+
memoizedIgnoreList (f, isOk) cacheKey
658658

659-
let private tryUrlOrBlacklist (f: _ -> Async<'a>) (isOk : 'a -> bool) (source:NuGetSource, id:UrlId) =
659+
let private tryUrlOrIgnore (f: _ -> Async<'a>) (isOk : 'a -> bool) (source:NuGetSource, id:UrlId) =
660660
let res =
661-
tryUrlOrBlacklistI
661+
tryUrlOrIgnoreI
662662
(fun s -> async { let! r = f s in return box r })
663663
(fun s -> isOk (s :?> 'a))
664664
(source,id)
@@ -669,15 +669,15 @@ let private tryUrlOrBlacklist (f: _ -> Async<'a>) (isOk : 'a -> bool) (source:Nu
669669

670670
type QueryResult = Choice<ODataSearchResult,System.Exception>
671671

672-
let tryAndBlacklistUrl doBlackList doWarn (source:NuGetSource)
672+
let tryAndIgnoreUrl doIgnore doWarn (source:NuGetSource)
673673
(tryAgain : QueryResult -> bool) (f : string -> Async<QueryResult>) (urls: UrlToTry list) : Async<QueryResult>=
674674
async {
675675
let! tasks, resultIndex =
676676
urls
677677
|> Seq.map (fun url -> async {
678678
let cached =
679-
if doBlackList then
680-
tryUrlOrBlacklist (fun () -> async { return! f url.InstanceUrl }) (tryAgain >> not) (source, url.UrlId)
679+
if doIgnore then
680+
tryUrlOrIgnore (fun () -> async { return! f url.InstanceUrl }) (tryAgain >> not) (source, url.UrlId)
681681
else
682682
async {
683683
let! result = f url.InstanceUrl
@@ -690,12 +690,12 @@ let tryAndBlacklistUrl doBlackList doWarn (source:NuGetSource)
690690
let! result = f url.InstanceUrl
691691
return Choice1Of3 result
692692
else
693-
return Choice3Of3 () // Url Blacklisted
693+
return Choice3Of3 () // Url Ignored
694694
| FirstCall task ->
695695
let! isOk, res = task |> Async.AwaitTask
696696
if not isOk then
697697
if doWarn then
698-
traceWarnIfNotBefore url.InstanceUrl "Possible Performance degradation, blacklist '%s'" url.InstanceUrl
698+
traceWarnIfNotBefore url.InstanceUrl "Possible Performance degradation, ignore '%s'" url.InstanceUrl
699699
return Choice2Of3 res
700700
else
701701
return Choice1Of3 res
@@ -736,5 +736,5 @@ let tryAndBlacklistUrl doBlackList doWarn (source:NuGetSource)
736736
| Some res -> res
737737
| None ->
738738
let urls = urls |> Seq.map (fun u -> u.InstanceUrl) |> fun s -> String.Join("\r\t - ", s)
739-
failwithf "All possible sources are already blacklisted. \r\t - %s" urls
739+
failwithf "All possible sources are already ignored. \r\t - %s" urls
740740
}

src/Paket.Core/Dependencies/NuGetV2.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ let parseODataEntryDetails (url,nugetURL,packageName:PackageName,version:SemVerI
263263

264264

265265
let getDetailsFromNuGetViaODataFast isVersionAssumed nugetSource (packageName:PackageName) (version:SemVerInfo) =
266-
let doBlacklist = not isVersionAssumed
266+
let doIgnore = not isVersionAssumed
267267
async {
268268
let normalizedVersion = version.Normalize()
269269
let urls =
@@ -377,7 +377,7 @@ let getDetailsFromNuGetViaODataFast isVersionAssumed nugetSource (packageName:Pa
377377
| Choice1Of2 _ -> false
378378
| _ -> true
379379

380-
let! result = NuGetCache.tryAndBlacklistUrl doBlacklist true nugetSource tryAgain handleUrl urls
380+
let! result = NuGetCache.tryAndIgnoreUrl doIgnore true nugetSource tryAgain handleUrl urls
381381
match result with
382382
| Choice1Of2 res -> return res
383383
| Choice2Of2 ex -> return raise (exn("error", ex))

src/Paket.Core/Installation/InstallProcess.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ let findPackageFolder root (groupName,packageName) (version,settings) =
7575
failwithf "Package directory for package %O was not found in %s. Storage mode is \"none\"." packageName d.FullName
7676
d
7777

78-
let contentFileBlackList : list<FileInfo -> bool> = [
78+
let contentFileIgnoreList : list<FileInfo -> bool> = [
7979
fun f -> f.Name = "_._"
8080
fun f -> f.Name.EndsWith ".transform"
8181
fun f -> f.Name.EndsWith ".pp"
@@ -112,7 +112,7 @@ let processContentFiles root project (usedPackages:Map<_,_>) gitRemoteItems opti
112112
|> Seq.toList
113113

114114
let copyContentFiles (project : ProjectFile, packagesWithContent) =
115-
let onBlackList (fi : FileInfo) = contentFileBlackList |> List.exists (fun rule -> rule(fi))
115+
let onIgnoreList (fi : FileInfo) = contentFileIgnoreList |> List.exists (fun rule -> rule(fi))
116116

117117
let rec copyDirContents (fromDir : DirectoryInfo, contentCopySettings, toDir : Lazy<DirectoryInfo>) =
118118
fromDir.GetDirectories() |> Array.toList
@@ -121,7 +121,7 @@ let processContentFiles root project (usedPackages:Map<_,_>) gitRemoteItems opti
121121
(fromDir.GetFiles()
122122
|> Array.toList
123123
|> List.filter (fun file ->
124-
if onBlackList file then false else
124+
if onIgnoreList file then false else
125125
if file.Name = "paket.references" then traceWarnfn "You can't use paket.references as a content file in the root of a project. Please take a look at %s" file.FullName; false else true)
126126
|> List.map (fun file ->
127127
let overwrite = contentCopySettings = ContentCopySettings.Overwrite

src/Paket.Core/PaketConfigFiles/InstallModel.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ module InstallModel =
837837
let targetsFile = t.Path
838838
(String.endsWithIgnoreCase (sprintf "%s.props" installModel.PackageName.Name) targetsFile||
839839
String.endsWithIgnoreCase (sprintf "%s.targets" installModel.PackageName.Name) targetsFile)))
840-
let filterBlackList = filterUnknownFiles
840+
let filterIgnoreList = filterUnknownFiles
841841

842842
let applyFrameworkRestrictions (restriction:FrameworkRestriction) (installModel:InstallModel) =
843843
match restriction with
@@ -960,7 +960,7 @@ module InstallModel =
960960
let createFromContent packageName packageVersion kind frameworkRestrictions content =
961961
emptyModel packageName packageVersion kind
962962
|> addNuGetFiles content
963-
|> filterBlackList
963+
|> filterIgnoreList
964964
|> applyFrameworkRestrictions frameworkRestrictions
965965
|> removeIfCompletelyEmpty
966966

@@ -972,7 +972,7 @@ module InstallModel =
972972
|> addAnalyzerFiles analyzerFiles
973973
|> addPackageLoadScriptFiles packageLoadScriptFiles
974974
|> addFrameworkAssemblyReferences nuspec.FrameworkAssemblyReferences
975-
|> filterBlackList
975+
|> filterIgnoreList
976976
|> applyFrameworkRestrictions frameworkRestrictions
977977
|> removeIfCompletelyEmpty
978978
|> addLicense nuspec.LicenseUrl
@@ -1052,7 +1052,7 @@ type InstallModel with
10521052

10531053
member this.AddFrameworkAssemblyReferences references = InstallModel.addFrameworkAssemblyReferences references this
10541054

1055-
member this.FilterBlackList () = InstallModel.filterBlackList this
1055+
member this.FilterIgnoreList () = InstallModel.filterIgnoreList this
10561056

10571057
member this.FilterExcludes excludes = InstallModel.filterExcludes excludes this
10581058

tests/Paket.Tests/InstallModel/ProcessingSpecs.fs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,10 @@ let ``should skip buckets which contain placeholder while adjusting upper versio
297297
|> Seq.map (fun f -> f.Path) |> shouldNotContain @"..\Rx-Main\lib\net20\Rx.dll"
298298

299299
[<Test>]
300-
let ``should filter _._ when processing blacklist``() =
300+
let ``should filter _._ when processing ignore list``() =
301301
let model =
302302
emptymodel.AddReferences([ @"..\Rx-Main\lib\net40\_._"; @"..\Rx-Main\lib\net20\_._" ] |> fromLegacyList @"..\Rx-Main\")
303-
.FilterBlackList()
303+
.FilterIgnoreList()
304304

305305
model.GetLegacyReferences(TargetProfile.SinglePlatform (DotNetFramework FrameworkVersion.V2))
306306
|> Seq.map (fun f -> f.Path) |> shouldNotContain @"..\Rx-Main\lib\net20\_._"
@@ -406,7 +406,7 @@ let ``should handle lib install of Microsoft.BCL for NET >= 40``() =
406406
@"..\Microsoft.Bcl\lib\net40\System.Threading.Tasks.dll"
407407

408408
@"..\Microsoft.Bcl\lib\net45\_._" ] |> fromLegacyList @"..\Microsoft.Bcl\")
409-
.FilterBlackList()
409+
.FilterIgnoreList()
410410

411411
model.GetLegacyReferences(TargetProfile.SinglePlatform (DotNetFramework FrameworkVersion.V3_5))
412412
|> Seq.map (fun f -> f.Path) |> shouldNotContain @"..\Microsoft.Bcl\lib\net40\System.IO.dll"
@@ -432,7 +432,7 @@ let ``should skip lib install of Microsoft.BCL for monotouch and monoandroid``()
432432
@"..\Microsoft.Bcl\lib\monoandroid\_._"
433433
@"..\Microsoft.Bcl\lib\monotouch\_._"
434434
@"..\Microsoft.Bcl\lib\net45\_._" ] |> fromLegacyList @"..\Microsoft.Bcl\")
435-
.FilterBlackList()
435+
.FilterIgnoreList()
436436

437437
model.GetLegacyReferences(TargetProfile.SinglePlatform (MonoAndroid MonoAndroidVersion.V1)) |> shouldBeEmpty
438438
model.GetLegacyReferences(TargetProfile.SinglePlatform MonoTouch) |> shouldBeEmpty
@@ -611,7 +611,7 @@ let ``should handle lib install of MicrosoftBcl``() =
611611
@"..\Microsoft.Bcl\lib\wpa81\_._"
612612
@"..\Microsoft.Bcl\lib\portable-net451+win81\_._"
613613
@"..\Microsoft.Bcl\lib\portable-net451+win81+wpa81\_._"]
614-
|> fromLegacyList @"..\Microsoft.Bcl\")).FilterBlackList()
614+
|> fromLegacyList @"..\Microsoft.Bcl\")).FilterIgnoreList()
615615

616616
model.GetLegacyReferences(TargetProfile.SinglePlatform (DotNetFramework FrameworkVersion.V4))
617617
|> Seq.map (fun f -> f.Path) |> shouldContain @"..\Microsoft.Bcl\lib\net40\System.IO.dll"
@@ -726,7 +726,7 @@ let ``should only handle dll and exe files``() =
726726
@"..\Fantomas\lib\FSharp.Core.dll"
727727
@"..\Fantomas\lib\Fantomas.exe" ] |> fromLegacyList @"..\Fantomas\",
728728
NuspecReferences.All)
729-
.FilterBlackList()
729+
.FilterIgnoreList()
730730

731731
model.GetLegacyReferences(TargetProfile.SinglePlatform (DotNetFramework FrameworkVersion.V2))
732732
|> Seq.map (fun f -> f.Path) |> shouldContain @"..\Fantomas\lib\FantomasLib.dll"
@@ -773,7 +773,7 @@ let ``should handle props files``() =
773773
InstallModel.EmptyModel(PackageName "xunit.runner.visualstudio",SemVer.Parse "0.1").AddTargetsFiles(
774774
[ @"..\xunit.runner.visualstudio\build\net20\xunit.runner.visualstudio.props"
775775
@"..\xunit.runner.visualstudio\build\portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid\xunit.runner.visualstudio.props" ] |> fromLegacyList @"..\xunit.runner.visualstudio\")
776-
.FilterBlackList()
776+
.FilterIgnoreList()
777777

778778
model.GetTargetsFiles(TargetProfile.SinglePlatform (DotNetFramework FrameworkVersion.V2))
779779
|> Seq.map (fun f -> f.Path) |> shouldContain @"..\xunit.runner.visualstudio\build\net20\xunit.runner.visualstudio.props"
@@ -784,7 +784,7 @@ let ``should handle global props files``() =
784784
InstallModel.EmptyModel(PackageName "xunit.runner.visualstudio",SemVer.Parse "0.1").AddTargetsFiles(
785785
[ @"..\xunit.runner.visualstudio\build\xunit.runner.visualstudio.props"
786786
@"..\xunit.runner.visualstudio\build\portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid\xunit.runner.visualstudio.props" ] |> fromLegacyList @"..\xunit.runner.visualstudio\")
787-
.FilterBlackList()
787+
.FilterIgnoreList()
788788

789789
model.GetTargetsFiles(TargetProfile.SinglePlatform (DotNetFramework FrameworkVersion.V2))
790790
|> Seq.map (fun f -> f.Path) |> shouldContain @"..\xunit.runner.visualstudio\build\xunit.runner.visualstudio.props"
@@ -794,7 +794,7 @@ let ``should handle Targets files``() =
794794
let model =
795795
InstallModel.EmptyModel(PackageName "StyleCop.MSBuild",SemVer.Parse "0.1").AddTargetsFiles(
796796
[ @"..\StyleCop.MSBuild\build\StyleCop.MSBuild.Targets" ] |> fromLegacyList @"..\StyleCop.MSBuild\")
797-
.FilterBlackList()
797+
.FilterIgnoreList()
798798

799799
model.GetTargetsFiles(TargetProfile.SinglePlatform (DotNetFramework FrameworkVersion.V2))
800800
|> Seq.map (fun f -> f.Path) |> shouldContain @"..\StyleCop.MSBuild\build\StyleCop.MSBuild.Targets"

tests/Playlists/paket.tests.playlist

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)