Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Relic Repolinter Improvements #174

Merged
merged 112 commits into from
Sep 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
6b2ea44
chore: Update eslintrc
prototypicalpro Jul 1, 2020
519259c
remove old eslintrc
prototypicalpro Jul 1, 2020
7e43778
Rework ruleset JSON structure, add JSON schema
prototypicalpro Jul 1, 2020
6175183
Add file-modify fix rule, add some comments to file_system
prototypicalpro Jul 1, 2020
4c42323
add schema for file-modify
prototypicalpro Jul 1, 2020
41e7334
Refactored index.js to reflect config changes, added comments
prototypicalpro Jul 1, 2020
c0b30e7
major refactor of rules/formatters
prototypicalpro Jul 8, 2020
4787209
bugfixes and polishing
prototypicalpro Jul 8, 2020
17e2da4
update formatting
prototypicalpro Jul 8, 2020
41c9856
fix bugs, add async support
prototypicalpro Jul 9, 2020
ee7380f
style and linter updates
prototypicalpro Jul 9, 2020
f1fd644
add file-create fix
prototypicalpro Jul 9, 2020
65649e7
fix broken paths with JSON schema
prototypicalpro Jul 9, 2020
6e232f9
fix code styling
prototypicalpro Jul 9, 2020
cb5c95d
more code style fixes
prototypicalpro Jul 9, 2020
c934ee9
more linting fixes
prototypicalpro Jul 9, 2020
307a845
more linting fixes
prototypicalpro Jul 9, 2020
619cc6d
fixed file_contests test
prototypicalpro Jul 9, 2020
908dd4e
minor clarity updates to config
prototypicalpro Jul 13, 2020
2b289b3
schema updates and file-create fixes
prototypicalpro Jul 13, 2020
d93e6ac
add nocase to file-hash
prototypicalpro Jul 13, 2020
04b3d7b
fix replace bug and add hash test
prototypicalpro Jul 13, 2020
d675282
almost finish fixing tests
prototypicalpro Jul 15, 2020
7ea6c83
fixed insecure module requiring, improved fs performance
prototypicalpro Jul 15, 2020
e077526
fixed axioms, JSON formatter
prototypicalpro Jul 17, 2020
4400f91
Add support for legacy config structure
prototypicalpro Jul 18, 2020
46d3010
add typescript types
prototypicalpro Jul 20, 2020
f36ab82
update types
prototypicalpro Jul 20, 2020
d780586
switch schema require to static list
prototypicalpro Jul 20, 2020
15a3bfb
add missing null test in axioms
prototypicalpro Jul 20, 2020
eeb9636
fix types
prototypicalpro Jul 20, 2020
40ec641
test using fix name for schema import
prototypicalpro Jul 20, 2020
58802b8
switch to declaritive module loading system
prototypicalpro Jul 20, 2020
a9b3bd6
hopefully make ncc happy with module loading system
prototypicalpro Jul 20, 2020
b73e461
remove unused jsconfig
prototypicalpro Jul 21, 2020
cd49ad8
add additional filesystem tests
prototypicalpro Jul 21, 2020
2be309d
fix node compatibility
prototypicalpro Jul 21, 2020
5f23a49
minor fixes to axiom system
prototypicalpro Jul 21, 2020
4ca1801
minor cleanup
prototypicalpro Jul 21, 2020
4130adb
changed schema to validate options instead of entire rule
prototypicalpro Jul 27, 2020
7c8375e
add policyInfo and policyUrl options to rule config
prototypicalpro Jul 27, 2020
f639f2a
add policyInfo and policyUrl test
prototypicalpro Jul 27, 2020
0303e07
add markdown formatter + tests
prototypicalpro Jul 28, 2020
2c0c211
update types
prototypicalpro Jul 28, 2020
551993b
move markdown-toc to dev dependencies
prototypicalpro Jul 29, 2020
c10f9d4
update formatting, tests
prototypicalpro Jul 29, 2020
7c6e7dc
change fix icon to hammer to reduce confusion
prototypicalpro Jul 29, 2020
b09d7ac
add pattern property to result
prototypicalpro Jul 29, 2020
4e986c3
update section and table order in markdown
prototypicalpro Jul 29, 2020
f7497d0
fix missing pattern parameter
prototypicalpro Jul 29, 2020
157372b
add pattern to single-line md formatter
prototypicalpro Jul 29, 2020
ff38fee
fix heading formatting issues
prototypicalpro Jul 29, 2020
3a38821
fix md formatter test
prototypicalpro Jul 29, 2020
b33ebc0
update formatter to fix links
prototypicalpro Jul 30, 2020
43f3c44
fix typo in md formatter
prototypicalpro Jul 30, 2020
037d1f9
add files for tests
prototypicalpro Aug 3, 2020
0ffee86
add CLI tests, fix minor rule bugs
prototypicalpro Aug 4, 2020
927e8d8
update file-modify to add newlines
prototypicalpro Aug 4, 2020
3b1b87a
switch to backtick quotes for file-modify
prototypicalpro Aug 4, 2020
f337a58
fix extra suggested fix section
prototypicalpro Aug 4, 2020
2b2b96c
add JSON schema validation rule
prototypicalpro Aug 5, 2020
ee97e21
add optional formatOptions and markdown disclaimer
prototypicalpro Aug 7, 2020
6368fd5
docs: add usage and rules documentation
prototypicalpro Aug 21, 2020
c13b39c
docs: add extra note to lint doc
prototypicalpro Aug 24, 2020
61f7281
docs: add development notes about structure
prototypicalpro Aug 24, 2020
ea62e16
docs: add JSDoc comments for formatter exports
prototypicalpro Aug 24, 2020
129d778
docs: update formatting in rules
prototypicalpro Aug 24, 2020
8a3463e
docs: add fixes reference
prototypicalpro Aug 24, 2020
8abf5d8
docs: add axiom reference and resources to usage
prototypicalpro Aug 24, 2020
11e7048
fix: fix axiom object with invalid axiom
prototypicalpro Aug 25, 2020
5e55bc6
tests: add API tests
prototypicalpro Aug 25, 2020
fa906dc
tests: add tests for file-create and file-modify
prototypicalpro Aug 25, 2020
e567745
tests: fix flaky filesystem tests
prototypicalpro Aug 25, 2020
4b692ec
tests: add axiom tests for licensee and linguist
prototypicalpro Aug 25, 2020
3048804
ci: update tests to include licensee and linguist
prototypicalpro Aug 25, 2020
717d87a
chore: bump version to 1.0.0
prototypicalpro Aug 25, 2020
d79822e
ci: update build to install linguist and licensee dependencies
prototypicalpro Aug 25, 2020
7ea46e7
ci: update linux dependencies
prototypicalpro Aug 25, 2020
aa67d04
ci: remove linguist and licensee from windows
prototypicalpro Aug 25, 2020
2679c84
ci: update gems to be installed globally
prototypicalpro Aug 25, 2020
8fc0540
fix: windows compatibility fixes
prototypicalpro Aug 25, 2020
3898ed5
fix: fix path seperator in symlink detection
prototypicalpro Aug 25, 2020
f965c11
ci: fix ruby gem flags
prototypicalpro Aug 25, 2020
d52353e
fix: windows fixes
prototypicalpro Aug 26, 2020
9d397ef
fix: update JSON schema URLs to point to TODOGroup repo
prototypicalpro Aug 26, 2020
fb6c743
feat: add YAML support in config
prototypicalpro Aug 26, 2020
d0ca1d1
docs: move usage to README
prototypicalpro Aug 26, 2020
5c0bf3a
docs: fix readme formatting
prototypicalpro Aug 26, 2020
57c0dfd
fix: fix flaky glob behavior with broken symlinks
prototypicalpro Aug 26, 2020
aa74d26
tests: remove retries from filesystem tests
prototypicalpro Aug 26, 2020
a154a89
fix: remove lstat check, fix flakey fs tests
prototypicalpro Aug 26, 2020
a003f62
chore: minor style update
prototypicalpro Aug 26, 2020
d5d6359
fix: remove accidental shadowing of fs
prototypicalpro Aug 26, 2020
0a1aab6
docs: add block chomping to YAML examples
prototypicalpro Aug 26, 2020
93a70a1
docs: remove YAML start tags from examples
prototypicalpro Aug 26, 2020
a360b91
tests: add longer timeout to licensee tests
prototypicalpro Aug 27, 2020
9e7bafd
docs: minor clarity changes
prototypicalpro Aug 27, 2020
8efdc53
BREAKING: switch dryRun and ruleset parameters for API backwards comp…
prototypicalpro Aug 27, 2020
bfe6315
docs: add changelog
prototypicalpro Aug 27, 2020
d67846e
Merge remote-tracking branch 'upstream/master'
prototypicalpro Aug 27, 2020
d200c51
fix: jsdoc initial rules
Aug 27, 2020
33d6384
fix: undo change
Aug 27, 2020
cd23a3a
fix: undo change
Aug 27, 2020
efaf9b8
Merge pull request #1 from newrelic-forks/fix_jsdoc
tangollama Aug 27, 2020
2a65dba
docs: add auto-generated API documentation
prototypicalpro Aug 28, 2020
d99b2d1
docs: Update links in README and CHANGELOG
prototypicalpro Aug 28, 2020
53e570a
ci: split documentation into own workflow
prototypicalpro Aug 28, 2020
002deae
fix: add backwards compatibility for blacklist -> denylist switch
prototypicalpro Aug 28, 2020
f3dc857
feat: merge contributor-count axiom into fork
prototypicalpro Aug 31, 2020
feef27a
Merge remote-tracking branch 'upstream/master'
prototypicalpro Aug 31, 2020
f0f6473
chore: update changelong
prototypicalpro Aug 31, 2020
fd62187
chore: fix apidoc compilation
prototypicalpro Aug 31, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/github-pages-deploy-action@3.5.9
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