Code Monkey home page Code Monkey logo

liz's Introduction

Hey, I'm Martin 👋

C# .NET Rider Visual Studio Git Markdown Python

About me 🤓

  • currently working as a Full-Stack(ish) C# Engineer
  • creating WPF Desktop Applications
  • creating Backend Services (i.e. with ASP.NET Core, or even something else)
  • love to create things that help others (such as NuGet-Packages, AddIns for Build-Automation, ...)
  • love Clean Code
  • currently learning more about Software-Architecture/Design/Quality 🧐
  • would love to learn more about App/Mulitplatform Development (i.e. Flutter, Kotlin) and Web Development (i.e. PHP, TypeScript, Angular, React, ...)
  • cat-dad
  • tech-nerd
  • gamer

🧾

  • Certified Professional for Software Architecture (Foundation Level)

Learn more about what I'm currently working on from my pinned projects


My GitHub Stats

wgnf

My Top Languages

NOTE: Top Languages does not indicate my skill level or anything like that, it's a GitHub metric of which languages have the most code on GitHub.

Top Languages

liz's People

Contributors

dependabot[bot] avatar wgnf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

liz's Issues

Ignore some URLs

i.e.:

  • LICENSE_URL_HERE_OR_DELETE_THIS_LINE
  • example.org
  • codeplex.com

provide the ability to set it from the outside

[BUG]: Package names are not case-insensitive

Description of the bug

In a recent project that got analyzed I saw that liz recognized both NUnit and nunit as separate packages, which is not correct, as the package names are all case-insensitive and should be treated that way by liz as well.

Steps to reproduce

  1. Add NUnit to a project
  2. Add nunit to a project reference with the same version
  3. Run liz on project from 1.
  4. Observe that NUnit and nunit are both recognized

Additional Information

No response

Move away from DI to Factory

The current approach relies on the presence of a Unity-DI-Container which is created and used in the .Tool project

  1. Creating and using the DI-Container in the .Tool project does not really make sense, it should rather be used in the .Core project (as this is the central point everyone else will be using (such as Cake, Nuke, Tool, ...)
  2. The project will have a large size yes, when it's finished, but there should be no need for a DI Container. Plus, this Dependency would be leaked to the consumers, which is also not ideal

According to the stuff said above, we should consider using a factory (which is also good way of providing the functionality to consumers (our Tool, Nuke, Cake Project and other users through NuGet) with a Settings and/or Options object as input

Yeah, that Factory will be the one central fuck-up point. But you gotta have that somewhere.

If stuff gets outta hand we can consider using a "self-made" Service Provider or something, but I don't think it's going to be necessary

[BUG]: Gathering dependencies on a german Windows does not work

Description of the bug

Executing liz on a german (or any other language than english) machine leads into an Exception being thrown when liz gatheres the dependencies of a project

Steps to reproduce

  1. have a non-english operating system
  2. execute liz
  3. observe Exception when dependencies are determined

Additional Information

This is due to the output of dotnet list package ... being in the OS language - here it's german:

grafik

This leads to issues, because the parser depends on finding strings like Resolved and Transitive Dependencies

Overhaul editorconfig

it bugs me that the current common behavior is to not use {} for if/else/foreach and such, when only one statement is used. A change her would be nice

Get Dependencies for an Old-Style-Project

  • old project format
  • most likely "just" parsing the package.info file
  • warning when "include transitive" = false, because it is transitive by design
  • whats with development dependencies?

[FEAT]: Sanitize HTML from https://licenses.nuget.org/XXX

Description of the feature/enhancement

When using the License-Expression when publishing a NuGet-Package, the licenseUrl will most likely point to https://licenses.nuget.org/{expression}.

Downloading the raw license-text from that page however, will result in a HTML-Web-Page being returned, which contains the raw license-text for, i.e. the MIT license. It would be nice when the raw license-text would also just contain that license text, and not the full blown HTML-Site

Additional Information

A similar site that is often used is https://choosealicense.com/, github.com, https://opensource.org/ and others

Add Progressbar to dotnet-CLI-Tool

Using https://github.com/Mpdreamz/shellprogressbar broken up in:

  • General Progressbar
    • GetProjects
    • Download Packages
      • project 1
      • project 2
      • ...
    • Get Package References
      • project 1
      • project 2
      • ...
    • Enrich with License-Information
      • reference 1
      • reference 2
      • ...

Some sort of ProgressManager would be needed for this - which can hold the total amount of ticks (4 - each main task) and can manage each sub-task with it's ticks (depending on the amount of projects, references, ...). The logger should not interfere with this procedure (except for showing the details and issues and messages >= Error) therefore should be disabled. But to be able to debug something, there should be a way to disable the progress-bar stuff, and display the regular logs.

Add documentation

  • dotnet-tool
    • how to install
    • how to use
    • options
    • examples
  • cake-addin
    • how to install cake-script --nuget-loaddependencies!
    • how to install cake-frosting
    • how to use cake-script
    • how to use cake-frosting
    • settings
    • examples
  • nuke-addin
    • how to install
    • how to use
    • settings
    • examples

Getting License Type by License Text

Sometimes License Types might not be easily recognized. If that's the case one might need to analyze the License Text (if found), by looking for certain snippets?

Benchmark Showcase

To be able to show how (hopefully) good this tool works, a benchmark showcase in the README would be nice

Filter projects

the user should be able to filter the found projects, i think of something like:

  • Concrete.Project.Name
  • *.Tests
  • Foo**Bar**Tests
  • Is something like the above with a simple wildcard enough?
  • I want to filter what projects have to be EXCLUDED
  • the user should be able to provide more than one exclude (separate by comma or semicolon or something)
  • Option name maybe --project-excludes?

Print Depdendency with License-Type and URL

I'd actually prefer an output by license type, like:

MIT:
- a
- b
- c

BSD-3:
- d
- f
- g
- h

Apache2.0:
- i
- j
- k
- l

marking license-types that are not allowed with an "!" or "*" or something

Make Dependencies Unique / Group Dependencies

When getting dependencies for multiple projects it might happen that the same dependency might be used multiple times. Those occasions should be accounted for, by making dependencies unique / grouping dependencies.
This may be done by:

  • Grouping by Dependency Name
  • Grouping by Dependency Name, Version
  • Making unique by Dependency Name, Version, Target-Framework

Include manual dependencies

The user might want to add manual dependencies. Name, Version, License-Text, License-URL, License-Type should be added for this manual thing

[BUG]: "download packages that are not in the cache" doesn't work with Central Package Management (CPM) enabled

Description of the bug

When a solution has the CPM enabled and during the analyzation some packages are not in the cache (which rarely happens) the remaining packages cannot be downloaded, because the current approach does not work when CPM is enabled

Steps to reproduce

  1. Create a solution where CPM is enabled
  2. Analyze using liz
  3. trigger "download packages that are not in cache"
  4. Observe error

Additional Information

the current download approach uses a dummy project using Version. When CPM is enabled one could use VersionOverride.
We'd have to see if we have to check if CPM is enabled for the current solution and switch the approach according or if VersionOverride can be used for everything.

And there is also an option EnableVersionOverride which can be disabled, which would break above mentioned approach too.

[BUG]: Some System.* packages are not being downloaded

Description of the bug

some System.* packages are not being downloaded (using dotnet restore) and with that information for that packages cannot be gathered...

Steps to reproduce

  1. Create a csproj which depends on i.e. System.Xml.XmlDocument
  2. Fire up liz
  3. --> no information for System.Xml.XmlDocument are gathered

Additional Information

No response

Proper Integration Tests

With checks for actual licenses being gathered. Can be used on the new TestingGround stuff

Need Integration Tests for:

  • Liz.Core (verify return-value)
  • Liz.Tool (verify console output)
  • Liz.Cake
    • used in code
    • as Cake-Script (verify console output?)
    • as Cake-Frosting (verify console output?)
  • Liz.Nuke (verify console output?)
    • used in code
    • as Nuke-Script (verify console output?)

Get License Information for Dependency - SDK-Style

  • License Type
  • License Text

idk how this might work, i know of these locations where Licenses might be:

  • NuGet-Property: PackageLicenseExpression
  • NuGet-Property: PackageLicenseUrl
  • LICENSE file embedded in NuGet

[FEAT]: WebAPI for processing

Description of the feature/enhancement

A WebAPI where you can upload your (project) files, which are then being processed, would be nice. So you're independent of any tool or environment.

Additional Information

A queueing approach would be needed, because analyzing files can take quite some time. Queue-Item-IDs should have uuids, so that no-one can look at the items from another person.

[FEAT]: Add caching

Sometimes licenses need to be gathered lots of times i.e. in scenarios like build pipelines.

Most of the time though, the versions don't change and the licenses don't need to be downloaded again.

So a cache would be nice, which has a key (which can be the Package + Version) and contains all the data we need (such as raw license text).

Maybe a second cache with the URL as the key would be nice too.

Maybe a Cache Version is needed, so that future version upgrades don't break anything (I.e. the next version adds a new property to the model, a cache item with a lower version than the current wouldn't have this property and so it wouldn't be valid)

Look at NCache what that library can do

The cache should be persisted to disk.

Add an option like --no-cache so that one can run the extraction without getting data from and writing data to the cache

Contribution process

Hello Martin,

I want to contribute to your project, but I cannot find any contribution process to follow.

Or I could help you directly on opened issues?

Exclude Project References?

maybe this can be done by using #5 ? Idk how to do this yet though, because we'd need the information which projects are actually in the solution and should be excluded... 🤔

Finish up .NET Tool

The current implementation of Liz.Tool is not quite finished yet and needs some finishing touches, such as:

<PackAsTool>true</PackAsTool>
<ToolCommandName>build</ToolCommandName>

... and the general metadata needed for NuGet-Packages

[BUG]: Packages from an old-style project are not being included when starting from an sdk-style project

Description of the bug

When analyzing the licenses starting from an sdk-style project, which has a project-reference on an old-style project, the packages defined in the old-style project (in the packages.config file) are not being included.

Steps to reproduce

  1. create an sdk-style project
  2. create an old-style project
  3. reference the old-style project from the sdk-style project
  4. add some packages to the old-style project
  5. run liz on the sdk-style project including transitive dependencies
  6. observe that the packages of the old-style project are not included

Additional Information

No response

[FEAT]: URL to license-information (license-type) mapping

Description of the feature/enhancement

there are probably some cases where information cannot be determined, but an URL could be extracted. For those cases a simple URL -> license-information would be helpful, to at least give the user the ability to ge the license-type for those cases

Additional Information

No response

[BUG]: Lower timeout when endpoint could not be reached

Description of the feature/enhancement

Currently the default timeout of 100s is used. Which can lead to long waiting times when i.e. nuget.org is down and someone tries to extract licenses with packages that point towards licenses.nuget.org.

This timeout should be lowered to something like maybe 10s, or even less.

Additional Information

No response

[FEAT]: Support composite licenses (SPDX expression syntax version 2.0)

Description of the feature/enhancement

The license Element can contain more than one license-expressions (see links below). This also needs to be supported and should also work when validating licenses:

  • OR/AND/... should be considered
  • when all OR-linked licenses are not allowed, fail the validation
  • when one or more AND-linked licenses are not allowed, fail the validation
  • when one or more OR-linked licenses are not allowed - but not all - give a warning

All given licenses should be exported and shown, given the provided settings.

Additional Information

Filter Dependencies

For whatever reason a user might want to filter some dependencies that he does not want to be considered, i think of something like

  • Concrete.Dependency.Name
  • Caliburn*
  • Microsoft**Abstractions
  • I want to filter what dependencies have to be EXCLUDED
  • the user should be able to provide more than one exclude (separate by comma or semicolon or something
  • Option name maybe --dependency-excludes?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.