Skip to content

Instantly share code, notes, and snippets.

View nkolev92's full-sized avatar

Nikolche Kolev nkolev92

View GitHub Profile
@nkolev92
nkolev92 / gist:251bf51416c85bc70f9b91e737e28397
Last active April 17, 2025 00:49
Means to enable opinionated warnings

I think this may be a good opportunity to introduce the concept of analysis level for NuGet warnings, or at minimum, add a way to enable warnings that are gated per framework for all frameworks instead.

Motivation

Scenario 1:

For the purposes of pruning, we introduced a few warnings

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>Lib</id>
<version>1.0.0</version>
<authors>Lib</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Package Description</description>
<dependencies>
<group targetFramework=".NETStandard2.0" />
{
"version": 3,
"targets": {
".NETFramework,Version=v4.7.2": {
"Microsoft.Build.Tasks.Git/1.0.0-beta2-19351-01": {
"type": "package",
"build": {
"build/Microsoft.Build.Tasks.Git.props": {},
"build/Microsoft.Build.Tasks.Git.targets": {}
},
:\Users\azdofeeds\Workdir\dotnet-core-setup>git clean -xdf
Removing .dotnet/
Removing .packages/
Removing Patched-SDK-3.0.100.zip
Removing Patched-SDK-3.0.100/
Removing artifacts/
C:\Users\azdofeeds\Workdir\dotnet-core-setup>build.cmd -ci -test /p:Configuration=Debug /p:OfficialBuildId=20390927.17 /p:TargetArchitecture=arm /p:PortableBuild=true /p:SkipTests=true /p:CertificateId=400 /p:DotNetSignType=test
##vso[task.setvariable isSecret=False;variable=Artifacts;isOutput=True]C:\Users\azdofeeds\Workdir\dotnet-core-setup\artifacts
##vso[task.setvariable isSecret=False;variable=Artifacts.Toolset;isOutput=True]C:\Users\azdofeeds\Workdir\dotnet-core-setup\artifacts\toolset
var sourceRepo = Repository.Factory.GetCoreV3(NuGetConstants.V3FeedUrl);
var resource = await sourceRepo.GetResourceAsync<FindPackageByIdResource>();
resource.GetAllVersionsAsync("packageId", new SourceCacheContext(), NullLogger.Instance, CancellationToken.None);
@nkolev92
nkolev92 / darc-init.ps1
Last active August 19, 2019 23:07
darc-init.ps1
param (
$darcVersion = $null,
$versionEndpoint = "https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16"
)
$verbosity = "d"
. $PSScriptRoot\tools.ps1
function InstallDarcCli ($darcVersion) {
$darcCliPackageName = "microsoft.dotnet.darc"
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
</packageSources>
<disabledPackageSources>
<clear />
</disabledPackageSources>
</configuration>
{
"version": 3,
"targets": {
".NETFramework,Version=v4.7.2": {}
},
"libraries": {},
"projectFileDependencyGroups": {
".NETFramework,Version=v4.7.2": []
},
"packageFolders": {
OJSimpson_,Elige,2019-01-05 20:32,
tarik_is_bestest,Tarik,2019-01-06 00:20,
madeintyo,ElIGE,2019-01-05 20:32,
DutchCSBestCS,ELiGE,2019-01-05 20:32,
TricoN - HLTV.org,Only 3.1% users pick suNny :D,2019-01-05 20:32,
OJSimpson_,F,2019-01-05 20:33,
16|0,Good for you, imagine adding all these users that picked EliGE,2019-01-05 20:41,
OJSimpson_,I didn’t, it was so high I just estimated it xd, it would probably only change it by around 1 percent,2019-01-05 20:47,
PandaDc1212,there is a chart for it for all the chosen players, 2019-01-05 23:01,
G0Dteukkab,go look your last thread i picked sunny, will i get my point?,2019-01-05 21:41,
{
"version": 3,
"targets": {
".NETCoreApp,Version=v2.1": {
"Microsoft.AspNet.WebApi.Client/5.2.6": {
"type": "package",
"dependencies": {
"Newtonsoft.Json": "10.0.1",
"Newtonsoft.Json.Bson": "1.0.1"
},