All Projects → komuw → ote

komuw / ote

Licence: MIT license
ote updates a packages' go.mod file with a comment next to all dependencies that are test dependencies; identifying them as such.

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to ote

As
VCV Rack Modules
Stars: ✭ 104 (+316%)
Mutual labels:  modules, mod
hangar
This is a plugin for the Kerbal Space Program. It provides several modules and parts to store complete vessels that aren't needed to free CPU of their burden.
Stars: ✭ 16 (-36%)
Mutual labels:  mod
Rebirth-Of-The-Night
Inspired by Terraria, 7 Days to Die, and more, Rebirth of the Night is a Minecraft 1.12.2 modpack with its own progression system, lore, mechanics, and art. It's built with the idea of remembering the central themes of what made Minecraft enjoyable and expanding them in every way, increasing the overall risk and reward as you progress.
Stars: ✭ 82 (+228%)
Mutual labels:  mod
FrostyFix
A tool to fix Frosty Support with games on platforms other than Origin (EA Desktop, Epic Games Store, Steam)
Stars: ✭ 37 (+48%)
Mutual labels:  mod
ffapi-project
A project containing all Fast Food related APIs and other things.
Stars: ✭ 21 (-16%)
Mutual labels:  mod
ME3TweaksModManager
Mod Manager for Mass Effect Original Trilogy and Mass Effect Legendary Edition
Stars: ✭ 83 (+232%)
Mutual labels:  mod
Rampant
Factorio Mod - Basic AI augmentation using potential fields
Stars: ✭ 39 (+56%)
Mutual labels:  mod
piw5 bot warfare
The Bot Warfare mod for PlutoniumIW5
Stars: ✭ 57 (+128%)
Mutual labels:  mod
ScanTree
Scan a JS file tree to build an ordered and grouped dependency listing
Stars: ✭ 51 (+104%)
Mutual labels:  dependency
cs-halloween-mod
🎃 Halloween Mod for Counter-Strike 1.6
Stars: ✭ 22 (-12%)
Mutual labels:  mod
modplayer-js
JavaScript player for SoundTracker mod files using AudioWorklet API
Stars: ✭ 30 (+20%)
Mutual labels:  mod
d2modmaker
A program that lets you mod Diablo II from a config
Stars: ✭ 82 (+228%)
Mutual labels:  mod
UIX-R
Ultima IX: Redemption for Morrowind and OpenMW
Stars: ✭ 32 (+28%)
Mutual labels:  mod
dna-monitor
A simple device monitoring tool for e-cigarettes with Evolv DNA chipset ☁️ 📈 Works with macOS and Linux
Stars: ✭ 25 (+0%)
Mutual labels:  mod
refraction
A Source Engine 2013 SP mod aimed to provide bug fixes and various development features
Stars: ✭ 23 (-8%)
Mutual labels:  mod
cheatgui
The Noita cheat gui mod, now in its own repo
Stars: ✭ 59 (+136%)
Mutual labels:  mod
ConsistencyPlus
Consistency+ is a mod that aims to fix the inconsistencies with block variants added by Mojang.
Stars: ✭ 63 (+152%)
Mutual labels:  mod
spotfire-mods
Spotfire Mods by TIBCO Spotfire®
Stars: ✭ 39 (+56%)
Mutual labels:  mod
Half-Life-Resurgence
Recreation & expansion of NPCs, entities, and weapons from the Half-Life series into Garry's Mod!
Stars: ✭ 52 (+108%)
Mutual labels:  mod
bymattlee-11ty-starter
A starter boilerplate powered by 11ty, Sanity, Gulp, Tailwind CSS, rollup.js, Alpine.js and Highway.
Stars: ✭ 27 (+8%)
Mutual labels:  modules

ote

ote ci codecov PkgGoDev Go Report Card

ote updates a packages' go.mod file with a comment next to all dependencies that are test dependencies; identifying them as such.

It's name is derived from Kenyan hip hop artiste, Oteraw(One third of the hiphop group Kalamashaka).

By default, go and its related tools(go mod etc) do not differentiate regular dependencies from test ones when updating/writing the go.mod file.
There are various reasons why this is so, see go/issues/26955 & go/issues/26913
Thus ote fills that missing gap.
It is not perfect, but it seems to work. See How it works

Installation

go install github.com/komuw/ote@latest

Usage

ote --help
examples:

    ote .                   # update go.mod in the current directory
        
    ote -f /tmp/someDir     # update go.mod in the /tmp/someDir directory

    ote -r                  # write to stdout instead of updating the go.mod in the current directory

    ote -f /tmp/someDir -r  # write to stdout instead of updating go.mod file in the /tmp/someDir directory.  

If your application has a go.mod file like the following;

module github.com/pkg/myPkg

go 1.17

require (
	github.com/Shopify/sarama v1.26.4
	github.com/google/go-cmp v0.5.0
	github.com/nats-io/nats.go v1.10.0
	github.com/stretchr/testify v1.6.1 // priorComment
	golang.org/x/mod v0.3.0
	github.com/golang/protobuf v1.4.2 // indirect
	github.com/nats-io/nats-server/v2 v2.1.7 // indirect
)

running ote will update the go.mod to the following;

module github.com/pkg/myPkg

go 1.17

require (
	github.com/Shopify/sarama v1.26.4
	github.com/nats-io/nats.go v1.10.0
	golang.org/x/mod v0.3.0
	github.com/golang/protobuf v1.4.2 // indirect
	github.com/nats-io/nats-server/v2 v2.1.7 // indirect
)

require (
	github.com/google/go-cmp v0.5.0 // test
	github.com/stretchr/testify v1.6.1 // test; priorComment
)

ie; assuming that github.com/google/go-cmp and github.com/stretchr/testify are test-only dependencies in your application.

Features.

  • Update go.mod file with a comment // test next to any dependencies that are only used in tests.
  • Makes only the minimal of changes to go.mod files.
  • Preserves any prior comments that were in existence.
  • If a dependency was a test-only dependency and then it starts been used in other non-test contexts, ote will also recognise that and remove the // test comment.

How it works

  1. read go.mod file.
  2. get all the imports of all the files used by the package
    here we consider all the known build tags(darwin, openbsd, riscv64 etc)
  3. get all the modules of which all the imports belong to.
  4. find which of those are test-only modules.
  5. update go.mod with a comment(// test) next to all the test dependencies.

Inspiration(Hat tip)

  1. x/mod.
  2. go/packages.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].