GithubHelp home page GithubHelp logo

referencegate's Introduction

Reference Gate

- for MSBuild and Common Project System (CPS) based projects

A reference not approved should end in a build error.

Ever discovered a reference that really shouldn't be in the project. It is there because some code needs a single method call in another assembly - and it really isn't neccesary. Tools like ReSharper makes it far to easy to add an external reference by accident. Reference Gate will make the build fail in cases like this.

You as a developer will need to maintain a whitelist.

NuGet package

Examples

Assembly references

Guarding the Reference variable.

<AssemblyReferenceWhitelist Include="System.Linq" />
<AssemblyReferenceBlacklist Include="System.Configuration" />
Package references

Guarding the PackageReference variable.

<PackageReferenceWhitelist Include="NUnit" />
<PackageReferenceBlacklist Include="Newtonsoft.Json" />
Project references

Guarding the ProjectReference variable.

<ProjectReferenceWhitelist Include="..\Newtonsoft.Json\Newtonsoft.Json.csproj" />
<ProjectReferenceBlacklist Include="..\Newtonsoft.Json.Tests\Newtonsoft.Json.Tests.csproj" />

Limitations

  • Both blacklisting and whitelisting at the same time is not supported. One method has to be chosen. This applies per project, per type*.
  • The comparison of references is based on case sensitive string compare. This may pose limits for file paths in assembly references and project references.

* Type being either assembly, package or project reference.

referencegate's People

Stargazers

Peder Husom avatar

Watchers

James Cloos avatar Espen Røvik Larsen avatar

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.