Giter VIP home page Giter VIP logo

modtools's Introduction

modtools - Keep your go.mod dependencies up-to-date.

modtools is a command-line toolset designed to help keeping the go.mod dependencies up-to-date while still allowing exceptions.

Why?

Dependency pinning has its obvious advantages: for a project with dozens of dependencies you don't want your build to break unpredictably due to a change in one of them. The flip side is that dependencies tend to become stale. The changes within the same major version should maintain compatibility and in most cases they don't actually break anything, but instead provide new features, bugfixes and security updates. That's why upgrading should be done on a regular basis.

Modtools is designed to make the process of upgrading dependencies easier. Running modtools check shows the list of direct and indirect dependencies that can be upgraded. It prints the list of commands that need to be run and exits with a non-zero code if such dependencies exist:

$ go install github.com/dop251/modtools@latest
$ modtools check
Some dependencies are out-of-date. Please upgrade by running 'modtools update' or the following commands:

go get github.com/kr/[email protected]
go get github.com/kr/[email protected]
go get gopkg.in/[email protected]

Error: check has failed

This command could be added to a CI pipeline running on a schedule or to a commit hook.

In case a new version of a dependency causes a problem it can be added to the exception list by running modtools freeze modpath so that it's ignored for up to the specified number of days:

$ modtools freeze gopkg.in/check.v1 14
Don't forget to add modtools_frozen.yml to the repository.

During this time the necessary adjustments need to be made to accommodate for the change (if it was deliberate), or a bug report should be raised if it wasn't. When the problem is fixed modtools thaw modpath can be used to remove modpath from the list of exceptions.

modtools's People

Contributors

dop251 avatar mstoykov avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

mstoykov

modtools's Issues

Flag to only report *direct* dependencies

I think it will be a good idea if modtools check (but also probably modtools update) work only on direct dependencies instead of all of them.

If there is any interest, and we can agree on the flag I can try to add it?

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.