Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Latest commit

 

History

History
128 lines (101 loc) · 4.12 KB

CONTRIBUTING.md

File metadata and controls

128 lines (101 loc) · 4.12 KB

Setup environments

$ make install-deps
asdf install
crystal 1.5.0 is already installed
dprint 0.30.3 is already installed
nodejs 18.7.0 is already installed
npm install

up to date, audited 691 packages in 1s

145 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

shards install
Resolving dependencies
Fetching https://github.com/crystal-ameba/ameba.git
Installing ameba (1.1.0)
Postinstall of ameba: make bin && make run_file
Writing shard.lock

crystal build src/cli.cr -o bin/cli

Tools

$ ./bin/cli -h
Usage: [arguments]
    -h, --help                       Show this help
    validate                         Validate definitions with renovate provided tool
    lint                             Lint definitions
    scaffold                         Generate files for first step of adding new plugins
    release                          Add git tags in default.json
    touch                            Update renovate.json labels to toriger renovate

Tests

$ make check
dprint check
./bin/cli lint
npx tsc
npx ts-node-test test/*.ts
crystal spec
./bin/cli validate

File type

  • Use *.json5 for all plugins to keep consistency. (Might be changed in future. VSCode does not run JSON schema for json5.)
  • Do NOT use JSON5 extended features except comments, just using JSON5 as an alternative JSONC in this repo.

Define plugins

Check actual Renovate behaviors

  1. Intentionally specify old version into example definition.
  2. Modify root config to trigger Renovate. So toggle "ignore-this-label-just-for-trigger-renovate-1" suffix.
  3. Check logs at dashboard.
  4. Check PR has been sent as correct.

Basic Regex ensuring

Looks not in RE2, however https://regex101.com is useful. See https://regex101.com/r/L2micV as an actual example for gauche

Check actual RE2 behavior with Node.js

https://github.com/google/re2/wiki/Syntax is the reference.

Actual behavior checking requires https://github.com/google/re2/ and the bindings.

$ brew install re2
$ npm install
$ node
Welcome to Node.js v18.9.0.
Type ".help" for more information.
> const RE2 = require("re2");
undefined
> let pattern = new RE2("^v(?<version>\\S+)");
undefined
> pattern.exec("v1.25.2");
[
  'v1.25.2',
  '1.25.2',
  index: 0,
  input: 'v1.25.2',
  groups: [Object: null prototype] { version: '1.25.2' }
]
> pattern.exec("v1.25.2").groups["version"];
'1.25.2'

Release new version with github-tags - # For maintainer

$ make release VERSION=0.4.2
Bumping to `0.4.2` ...
Done! you should manually push to GitHub with ...
$ git push origin 0.4.2
Completed!

Note