Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A CLI tool to implement regular code rub into a repository.

License

NotificationsYou must be signed in to change notification settings

AgentEnder/code-rub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository implements a base layer, CLI, and a few plugins to automate the process described here:https://hassanhabib.com/2020/02/09/code-rub/.

The core of code-rub is agnostic to ticketing system, project philosophy, and technology. On its own, it will do nothing except keep track of which files have been assigned for a rub, but it doesn't know how to actually create tickets and assign them. It doesn't even log them to the console by default.

Quick Start

Currently, a jira plugin and an azure-devops plugin are provided. If this suits your use case, runnpx code-rub init --preset {jira|azure-devops}, and then fill in the placeholder values created incode-rub.config.js.

If this doesn't suit your use case, runnpx code-rub init to generate a blank configuration. There are examples of local plugins in this repo's tool folder, and thecode-rub.config.js file here demonstrates how to point to them. They can be either typescript or javascript. There are future plans to add azure-devops and github issues based support, but they are not yet implemented. PRs adding them are welcome 😀

Plugins

This is where the plugins come in. A code-rub plugin can change almost everything about the flow ofnpx code-rub. They can provide:

  • A setup function:setup
  • An initial configuration, used innpx code-rub init --preset:initialConfiguration
  • A method to process assignments, after they are generated:processAssignments
  • A method to process the file queue, useful for filtering out file extensions or paths:processFileQueue
  • A method to process theIgnore object used when generating the repository file map:processIgnore
    • This is ran beforecode-rub saves the file map, so it affects all configuration files. This should only be specified in the repositories base configuration (or sole configuration).
  • A method to read and write the file map:readFileMap andsaveFileMap respectively.
    • Only one plugin may specify these methods.

Plugins are specified by two pieces of configuration, theplugins array and thepluginConfiguration object. Plugin's are loaded based on theplugins array, and the capabilities they provide are configured through their entry inpluginConfiguration.

Plugins are loaded, and executed based on their order in theplugins array. This is especially important for functions likeprocessFileQueue which chains the results during execution.

As an example, imagine you have plugin1 which removes typescript files but plugin2 expects them to be present. If you useplugins: [plugin1, plugin2], plugin2 would not see any of the typescript files. If you useplugins: [plugin2, plugin1], plugin2 would see them since they are not removed yet.

For an example plugin implementation, check thejira package in this repository.

About

A CLI tool to implement regular code rub into a repository.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp