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

chore: update cli yargs config to highlight "ruleset*" options are mutually exclusive. #308

Merged
merged 3 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
30 changes: 11 additions & 19 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@ jobs:
fail-fast: false
matrix:
node-version: ['19', '18', '16', '14']
os: ['windows-latest', 'ubuntu-latest', 'macos-latest']
os: ['windows-latest', 'ubuntu-latest', 'macos-13', 'macos-latest']
exclude:
# exclude node14 test on arm due to nodejs 14 release is not available for darwin-arm
- node-version: '14'
os: 'macos-latest'
runs-on: ${{ matrix.os }}
name: Node ${{ matrix.node-version }} sample (${{ matrix.os }})
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

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

Expand All @@ -27,7 +31,7 @@ jobs:
echo "::set-output name=dir::$(npm config get cache)"

- name: Cache NPM
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
Expand All @@ -39,7 +43,7 @@ jobs:

- name: Setup Python for Github-Markup
if: ${{ runner.os != 'Windows' }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'

Expand All @@ -59,30 +63,18 @@ jobs:
sudo apt-get update
sudo apt-get install -y build-essential libicu-dev libcurl4-openssl-dev libldap2-dev libidn11-dev

- name: Setup Ruby
if: ${{ runner.os != 'Windows' }}
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1.4'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

- name: Run Test
if: ${{ runner.os != 'Windows' }}
run: bundle exec npm test

- name: Run Test (Windows)
if: ${{ runner.os == 'Windows' }}
run: npm test

test-docker:
runs-on: ubuntu-latest
name: Docker sample
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
Expand Down
93 changes: 54 additions & 39 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,65 +1,75 @@
GEM
remote: https://rubygems.org/
specs:
RedCloth (4.3.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
asciidoctor (2.0.12)
RedCloth (4.3.4)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
asciidoctor (2.0.23)
base64 (0.2.0)
builder (3.2.4)
cgi (0.4.1)
charlock_holmes (0.7.7)
commonmarker (0.23.10)
creole (0.5.0)
dotenv (2.7.6)
escape_utils (1.2.1)
dotenv (3.1.2)
expression_parser (0.9.0)
faraday (1.3.0)
faraday-net_http (~> 1.0)
multipart-post (>= 1.2, < 3)
ruby2_keywords
faraday-net_http (1.0.1)
github-linguist (7.13.0)
faraday (2.9.1)
faraday-net_http (>= 2.0, < 3.2)
faraday-net_http (3.1.0)
net-http
github-linguist (7.29.0)
cgi
charlock_holmes (~> 0.7.7)
escape_utils (~> 1.2.0)
mini_mime (~> 1.0)
rugged (>= 0.25.1)
github-markup (4.0.0)
rugged (~> 1.0)
github-markup (4.0.2)
htmlentities (4.3.4)
idn-ruby (0.1.0)
licensee (9.15.1)
dotenv (~> 2.0)
octokit (~> 4.20)
reverse_markdown (~> 1.0)
idn-ruby (0.1.5)
licensee (9.17.0)
dotenv (>= 2, < 4)
octokit (>= 4.20, < 9.0)
reverse_markdown (>= 1, < 3)
rugged (>= 0.24, < 2.0)
thor (>= 0.19, < 2.0)
mini_mime (1.0.2)
mini_portile2 (2.8.1)
multipart-post (2.1.1)
nokogiri (1.14.3)
mini_portile2 (~> 2.8.0)
mini_mime (1.1.5)
net-http (0.4.1)
uri
nokogiri (1.16.5-aarch64-linux)
racc (~> 1.4)
octokit (4.20.0)
faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
nokogiri (1.16.5-arm-linux)
racc (~> 1.4)
nokogiri (1.16.5-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.5-x86-linux)
racc (~> 1.4)
nokogiri (1.16.5-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.5-x86_64-linux)
racc (~> 1.4)
octokit (8.1.0)
base64
faraday (>= 1, < 3)
sawyer (~> 0.9)
org-ruby (0.9.12)
rubypants (~> 0.2)
public_suffix (4.0.6)
racc (1.6.2)
public_suffix (5.0.5)
racc (1.8.0)
rdoc (6.3.4.1)
reverse_markdown (1.4.0)
reverse_markdown (2.1.1)
nokogiri
ruby2_keywords (0.0.4)
rubypants (0.7.1)
rugged (1.1.0)
sawyer (0.8.2)
rugged (1.7.2)
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (> 0.8, < 2.0)
thor (1.1.0)
faraday (>= 0.17.3, < 3)
thor (1.3.1)
twitter-text (3.1.0)
idn-ruby
unf (~> 0.1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
unf_ext (0.0.9.1)
uri (0.13.0)
wikicloth (0.8.3)
builder
expression_parser
Expand All @@ -68,7 +78,12 @@ GEM
twitter-text

PLATFORMS
ruby
aarch64-linux
arm-linux
arm64-darwin
x86-linux
x86_64-darwin
x86_64-linux

DEPENDENCIES
RedCloth (~> 4.3)
Expand All @@ -83,4 +98,4 @@ DEPENDENCIES
wikicloth (~> 0.8.3)

BUNDLED WITH
2.1.4
2.5.11
8 changes: 5 additions & 3 deletions bin/repolinter.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ require('yargs')
.option('rulesetFile', {
alias: 'r',
describe:
'Specify an alternate location for the repolinter configuration to use (This will default to repolinter.json/repolinter.yaml at the root of the project, or the internal default ruleset if none is found).',
'Specify an alternate file location for repolinter configuration to use. This option is mutually exclusive from all other "ruleset*" options. If no "ruleset*" option provided, repolinter will use default repolinter.json/repolinter.yaml at the root of the project.',
type: 'string'
})
.option('rulesetUrl', {
alias: 'u',
describe:
'Specify an alternate URL repolinter configuration to use (This will default to repolinter.json/repolinter.yaml at the root of the project, or the internal default ruleset if none is found).',
'Specify an alternate URL location for repolinter configuration to use. This option is mutually exclusive from all other "ruleset*" options. If no "ruleset*" option provided, repolinter will use default repolinter.json/repolinter.yaml at the root of the project.',
type: 'string'
})
.option('rulesetEncoded', {
alias: 'c',
describe:
'Specify a base64 encoded ruleset that repolinter will decode and use instead.',
'Specify a base64 encoded ruleset that repolinter will decode and use instead. This option is mutually exclusive from all other "ruleset*" options. If no "ruleset*" option provided, repolinter will use default repolinter.json/repolinter.yaml at the root of the project',
type: 'string'
})
.option('git', {
Expand All @@ -67,6 +67,8 @@ require('yargs')
default: 'console',
type: 'string'
})
.conflicts('rulesetFile', ['rulesetUrl', 'rulesetEncoded'])
.conflicts('rulesetEncoded', 'rulesetUrl')
},
async (/** @type {any} */ argv) => {
let tmpDir = null
Expand Down
Loading
Loading