Skip to content

Git history navigation for dedicated methods, across all kinds of changes incl. complex refactorings.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE
MIT
LICENSE_ORIGINAL
Notifications You must be signed in to change notification settings

jbwheatley/sbt-codeshovel

 
 

Repository files navigation

sbt-codeshovel

Tag

"Take this shovel to dig in source code history for changes to specific methods and functions."

Getting Started

sbt-codeshovel is available through Maven Central.

Add the sbt plugin to plugins.sbt:

addSbtPlugin("io.github.jbwheatley" %% "sbt-codeshovel" % xxx)

and enable in build.sbt:

enablePlugins(CodeShovelPlugin)

Usage

Start an sbt shell in the root of your repo, and run the following:

shovel ${path/to/the/file.scala} ${functionName} ${lineNumber} ${commit}

For example, to run against this function in pact4s starting from the HEAD commit:

shovel shared/src/main/scala/pact4s/StateChanger.scala handle 68 HEAD

sbt-codeshovel also works for java, js and ts files.

A .html file will then be produced and placed in the /target directory (e.g. /target/shovel-handle-68-HEAD.html). Opening this in your browser will allow you to browse the git history for the supplied method. Check the example here.

Use with other build tools (Mill, Bazel)

The core functionality of codeshovel is released as its own standalone library to be used with other build tools:

"io.github.jbwheatley" %% "codeshovel" % xxx

The method codeshovel.Execution.run can be used to produce the html document:

run(
  repositoryName = "pact4s",
  baseDir = "/Users/jbwheatley/pact4s",
  filePath = "shared/src/main/scala/pact4s/StateChanger.scala",
  functionName = "handle",
  startLine = 68,
  startCommitName = "HEAD"
)

Background

sbt-codeshovel is a fork of ataraxie/codeshovel which is based on research by the Software Practices Lab at UBC in Vancouver, Canada. This plugin takes their excellent original work and extends it to work for scala functions, and makes it more convenient for everyday development needs.

About

Git history navigation for dedicated methods, across all kinds of changes incl. complex refactorings.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE
MIT
LICENSE_ORIGINAL

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 91.9%
  • Scala 7.0%
  • Other 1.1%