Giter Site home page Giter Site logo

header's Introduction

Header

Utilities for checking and updating headers in files.

A big thanks to sbt-header which this project is based on.

Mill - Basic Usage

> mill __.headerCheck
> mill __.headerCreate

In build.sc file:

import $ivy.`com.lewisjkl::header-mill-plugin::0.0.3`
import header._

Apache 2

import header._

object core extends HeaderModule {
  override def license: HeaderLicense = HeaderLicense.Apache2("2023", "lewisjkl")
}

MIT

import header._

object core extends HeaderModule {
  override def license: HeaderLicense = HeaderLicense.MIT("2023", "lewisjkl")
}

Custom

import header._

object core extends HeaderModule {
  override def license: HeaderLicense = HeaderLicense.Custom(
  """|The contents of this file is free and unencumbered software released into the
     |public domain. For more information, please refer to <http://unlicense.org/>""".stripMargin
  )
}

Mill Customization

import header._

object core extends HeaderModule {
  override def license: HeaderLicense = HeaderLicense.Apache2("2023", "lewisjkl")

  // defaults to List("scala")
  override def includeFileExtensions: List[String] = List("scala", "java")

  // if you want more control, you can use the following instead of `includeFileExtensions`
  // This shows the default implementation, but you can make it whatever you would like.
  override def skipFilePredicate: os.Path => Boolean = path => {
    os.isFile(path) && !includeFileExtensions.exists(ext =>
      path.segments.toList.last.endsWith(s".$ext")
    )
  }

  // defaults to this.millSourcePath, change this to change where the header checking/creation starts
  // looking for files
  override def headerRootPath: os.Path = millSourcePath
}

header's People

Contributors

daddykotex avatar lewisjkl avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

daddykotex

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.