Skip to content
This repository has been archived by the owner on Dec 20, 2017. It is now read-only.
/ auto-copyright Public archive

Inserts and automatically updates the standard copyright notice at the top of the file.

License

Notifications You must be signed in to change notification settings

lee-dohm/auto-copyright

Repository files navigation

Auto-Copyright

Build Status Dependency Status Project unmaintained

Inserts or updates a copyright notice.

🚨 Unmaintained 🚨

This package is no longer maintained. All issues and PRs have been closed and the repository has been archived. This is remaining published in the Atom package repository so that people can find it to fork it and create their own version. Hopefully one of them will create a new maintained version.

Usage

Insert

The auto-copyright:insert command adds the configured copyright text with the current year and configured owner text as a comment at the top of the file. The default copyright text looks like this:

#
# Copyright (c) 2015 by Placeholder Corporation. All Rights Reserved.
#

It can be configured to say as much or as little as you want, though.

Update

When you execute the auto-copyright:update command, it updates the copyright year in a standard format by adding the current year to the list of years and compacting it in the following ways:

  • Disjoint years are separated by commas: 2000, 2005 and 2010 are represented as 2000, 2005, 2010
  • Years in a series are represented by the start and end years separated by a hyphen: 2001, 2002 and 2003 are represented as 2001-2003
  • Mixing and matching works too: 2001, 2002, 2003, 2005 and 2010 are represented as 2001-2003, 2005, 2010

Configuration

Auto Copyright supports the following configuration settings:

  • auto-copyright.buffer — Number of blank commented lines before and after the copyright text. (Defaults to: 1)
  • auto-copyright.owner — Owner name to use when creating the copyright text.
  • auto-copyright.template — Copyright template to follow. %y will be replaced with the current year. %o will be replaced with the owner name. (Defaults to: Copyright (c) %y by %o. All Rights Reserved.)

Multi-line templates are supported. At the time of this writing, Atom's Settings View does not support multiline configuration attributes. In order to have a multi-line template, you must manually edit your config.cson using the CoffeeScript multi-line string format. For example:

'*':
  'auto-copyright':
    'template': """
      Copyright (c) %y by %o. All Rights Reserved.

      Some standard boilerplate license text.
    """

Commands

  • auto-copyright:insert — Inserts the copyright text at the top of the file in the active editor
  • auto-copyright:update — Updates the year range of the copyright text at the top of the file, if it exists

Keybindings

No keybindings are assigned by default.

License

MIT

About

Inserts and automatically updates the standard copyright notice at the top of the file.

Resources

License

Stars

Watchers

Forks

Packages

No packages published