From 702b8a6fc620a4001fce69e18b8c1d83ee41c4d8 Mon Sep 17 00:00:00 2001 From: August Valera <4U6U57@gmail.com> Date: Sat, 24 Feb 2018 21:50:18 -0800 Subject: [PATCH 1/3] Change dependency markdownlint to markdownlint-cli markdownlint-cli is the recommended cli for the markdownlint package See https://www.npmjs.com/package/markdownlint#related Unit tests should now fail due to markdownlint actually linting md files --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 730ea29..0af7a97 100644 --- a/package.json +++ b/package.json @@ -34,8 +34,8 @@ "scripts": { "lint:editorconfig": "eclint check git-open* readme* .travis.yml", "lint:package": "pjv --recommendations --warnings", - "lint:readme": "node ./node_modules/markdownlint/lib/markdownlint.js --config markdownlint.json README.md", - "lint:man": "node ./node_modules/markdownlint/lib/markdownlint.js --config markdownlint.json git-open.1.md", + "lint:readme": "markdownlint --config markdownlint.json README.md", + "lint:man": "markdownlint --config markdownlint.json git-open.1.md", "man": "marked-man --version \"git-open $npm_package_version\" --manual \"Git manual\" --section 1 git-open.1.md > git-open.1", "test": "npm run unit && npm run lint:package && npm run lint:man && npm run lint:readme && npm run lint:editorconfig", "unit": "bats test/", @@ -44,7 +44,7 @@ "dependencies": {}, "devDependencies": { "eclint": "^2.1.0", - "markdownlint": "^0.2.0", + "markdownlint-cli": "^0.7.1", "marked-man": "^0.2.1", "package-json-validator": "^0.6.1" } From 5b815cb6194af883d2b57c2017a1d105d418fc8c Mon Sep 17 00:00:00 2001 From: August Valera <4U6U57@gmail.com> Date: Sat, 24 Feb 2018 22:00:30 -0800 Subject: [PATCH 2/3] Fix current errors in Markdown files Also: add package-lock.json to gitignore Remove prefix $ for commands in the manpage, hope people aren't angry Add MD034 to markdownlint ignore (bare links, which are helpful for the manpage) --- .gitignore | 1 + README.md | 3 ++- git-open.1.md | 11 ++++++----- markdownlint.json | 1 + 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 4da59cd..e9883c6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules/ sandboxrepo git-open.1 +package-lock.json diff --git a/README.md b/README.md index a1822ed..664708c 100644 --- a/README.md +++ b/README.md @@ -130,11 +130,12 @@ from which this plugin was forked. Please provide examples of the URLs you are parsing with each PR. You can run `git-open` in `echo` mode, which doesn't open your browser, but just prints the URL to stdout: + ```sh env BROWSER='echo' ./git-open ``` -#### Testing: +### Testing: You'll need to install [bats](https://github.com/sstephenson/bats#installing-bats-from-source), the Bash automated testing system. It's also available as `brew install bats` diff --git a/git-open.1.md b/git-open.1.md index d11f915..72bb410 100644 --- a/git-open.1.md +++ b/git-open.1.md @@ -26,25 +26,25 @@ git hosting services are supported. ## EXAMPLES ```sh -$ git open +git open ``` It opens https://github.com/TRACKED_REMOTE_USER/CURRENT_REPO/ ```sh -$ git open someremote +git open someremote ``` It opens https://github.com/PROVIDED_REMOTE_USER/CURRENT_REPO/ ```sh -$ git open someremote somebranch +git open someremote somebranch ``` It opens https://github.com/PROVIDED_REMOTE_USER/CURRENT_REPO/tree/PROVIDED_BRANCH ```sh -$ git open --issue +git open --issue ``` If branches use naming convention of `issues/#123`, it opens @@ -72,7 +72,7 @@ To configure git-open you may need to set some `git config` options. You can use `--global` to set across all repos, instead of just the current repo. ```sh -$ git config [--global] option value +git config [--global] option value ``` ### Configuring which remote to open @@ -106,6 +106,7 @@ git config [--global] open.[gitdomain].protocol [value] ``` **Example** + - Your git remote is at `ssh://git@git.internal.biz:7000/XXX/YYY.git` - Your hosted gitlab is `http://repo.intranet/subpath/XXX/YYY` diff --git a/markdownlint.json b/markdownlint.json index 6ed27b9..334bf87 100644 --- a/markdownlint.json +++ b/markdownlint.json @@ -9,6 +9,7 @@ "MD013": false, "MD026": false, "MD033": false, + "MD034": false, "MD036": false, "MD041": false } From c3fd9a48df0c8ce7a3a2faa0e5c3d08470f7890a Mon Sep 17 00:00:00 2001 From: August Valera <4U6U57@gmail.com> Date: Mon, 26 Feb 2018 22:15:35 -0800 Subject: [PATCH 3/3] Revert gitignore package-lock, fix #115 Remove package-lock.json from gitignore for npm Fix bug in #115 that modified user's gitconfig when running tests --- .gitignore | 1 - test/git-open.bats | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e9883c6..4da59cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ node_modules/ sandboxrepo git-open.1 -package-lock.json diff --git a/test/git-open.bats b/test/git-open.bats index 513535d..50808ac 100755 --- a/test/git-open.bats +++ b/test/git-open.bats @@ -40,7 +40,7 @@ setup() { ## @test "url: insteadOf handling" { - git config --global url.http://example.com/.insteadOf ex: + git config --local url.http://example.com/.insteadOf ex: git remote set-url origin ex:example.git git checkout -B master run ../git-open