Skip to content

Commit

Permalink
New Relic Repolinter Improvements (#174)
Browse files Browse the repository at this point in the history
* changes from New Relic
Co-authored-by: Joel Worrall <[email protected]>
  • Loading branch information
prototypicalpro authored Sep 30, 2020
1 parent dbc2aa4 commit cd30875
Show file tree
Hide file tree
Showing 117 changed files with 15,183 additions and 3,986 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
5 changes: 0 additions & 5 deletions .eslintrc

This file was deleted.

22 changes: 22 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
env:
commonjs: true
es6: true
node: true
mocha: true
extends:
- 'eslint:recommended'
- 'plugin:jsdoc/recommended'
- 'standard'
globals:
Atomics: 'readonly'
SharedArrayBuffer: 'readonly'
parserOptions:
ecmaVersion: 2018
rules:
jsdoc/require-jsdoc: 0
jsdoc/check-tag-names: 0
settings:
jsdoc:
mode: 'typescript'
plugins:
- 'jsdoc'
49 changes: 43 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,53 @@ on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: ['12', '10']
name: Node ${{ matrix.node }} sample
os: ['windows-latest', 'ubuntu-latest', 'macos-latest']
runs-on: ${{ matrix.os }}
name: Node ${{ matrix.node-version }} sample (${{ matrix.os }})
steps:
- uses: actions/checkout@v1
- name: Setup node
- name: Checkout
uses: actions/checkout@v1

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test

- name: Cache NPM
id: cache-node-modules
uses: actions/cache@v1
env:
cache-name: node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
- name: Install NPM Dependencies
run: npm ci

- name: Setup Licensee and Linguist Dependencies (MacOS)
if: ${{ runner.os == 'macOS' }}
run: brew install cmake pkg-config icu4c

- name: Setup Licensee and Linguist Dependencies (Linux)
if: ${{ runner.os == 'Linux' }}
run: sudo apt-get update && sudo apt-get install -y build-essential libicu-dev libcurl4-openssl-dev

- name: Setup Ruby
if: ${{ runner.os != 'Windows' }}
uses: actions/setup-ruby@v1
with:
ruby-version: '2.6'

- name: Install Licensee and Linguist
if: ${{ runner.os != 'Windows' }}
run: gem install --no-document licensee github-linguist

- name: Run Test
run: npm test
42 changes: 42 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Documentation
on:
push:
branches:
- master

jobs:
documentation:
name: Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Cache NPM
id: cache-node-modules
uses: actions/cache@v1
env:
cache-name: node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
- name: Install NPM Dependencies
run: npm ci

- name: Build Documentation
run: npm run apidoc

- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: apidoc # The folder the action should deploy.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ coverage/
node_modules/
tmp/
.idea/
vendor/
.bundle
out
6 changes: 4 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
"name": "Launch Program",
"program": "${workspaceRoot}/bin/repolinter.js",
"args":[
"."
"lint",
"--git",
"https://github.com/todogroup/repolinter.git"
]
}
]
}
}
1 change: 0 additions & 1 deletion CHANGELOG

This file was deleted.

36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Changelog

## 1.0.0

### Breaking Changes
* The ruleset configuration format has been upgraded to [version 2](./README.md#creating-a-ruleset), including adding a [JSON schema](./rulesets/schema.json) and support for YAML. The previous ruleset format is still supported, however it is recommended that you translate your rulesets for this upgrade.
* Major changes have been made to the `lint` function:
* Formatting and printing have been moved outside `lint`, allowing the developer to suppress or modify the output as needed. This change is reflected in the new [CLI implementation](./bin/repolinter.js).
* The object returned by lint (`LintResult`) has been completely restructured.
* A `dryRun` parameter has been added to disable fixes.
* `async` was added to the function interface.
* Major changes have been make to the [JSON Formatter](index.js) to accommodate the structure change of `LintResult`.
* Non top-level configuration support (ex. `targetdir/otherdir/repolinter.json` would trigger another lint of `otherdir`) has been removed for now.
* Renamed several rule options to more clearly convey functionality (`files` -> `globsAny`) and remove problematic language (`blacklist` -> `denylist`). Backwards compatibility for old property names in version 1 rulesets is still maintained, however the schema will fail to validate in version 2.
* Some slight changes have been made to the default formatter to accommodate the feature list below.

### Features
* [Automatic fixes](./docs/md/fixes.md) have been added. These fixes must be [configured in your ruleset](./README.md#rules) before they can be used, but are otherwise enabled by default.
* [Markdown formatting](README.md#formatting-the-output) is now supported via a CLI argument.
* CLI argument parsing has re-implemented with [Yargs](https://github.com/yargs/yargs) to allow for a more user-friendly experience. All previous commands and arguments remain, and the following new options are now available:
* `--dryRun`/`-d` - Disable fixes.
* `--allowPaths`/`-a` - Specify an allowlist that repolinter should limit itself to.
* `--rulesetFile`/`-r` - Manually specify the configuration repolinter should use.
* `--rulesetUrl`/`-u` - Specify a URL where repolinter can retrieve the ruleset from.
* `--format`/`-f` - Change the output format.

For more information on these options please see the [Repolinter CLI](./bin/repolinter.js).
* Added several other functions to the Node API: `runRuleset`, `determineTargets`, `validateConfig`, and `parseConfig`.
* Added TypeScript types for the Node API.
* Add numerical comparison support for axioms and the [`contributor-count`](./docs/md/axioms.md#contributor-count) axiom.

### Fixes
* All file-based operations have been moved to `fs.promises`, which increased performance by a factor of 10.
* Fixed some issues with Windows paths.
* Updated NPM dependencies.
* Added more tests and [autogenerated documentation](https://newrelic-forks.github.io/repolinter/).
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ DEPENDENCIES
licensee (>= 9.9.0)

BUNDLED WITH
1.16.2
2.1.4
Loading

0 comments on commit cd30875

Please sign in to comment.