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

There should be a way to ignore "repository" in package.json #28

Closed
NickHeiner opened this issue Jan 5, 2019 · 3 comments
Closed

There should be a way to ignore "repository" in package.json #28

NickHeiner opened this issue Jan 5, 2019 · 3 comments
Labels
🙋 no/question This does not need any changes

Comments

@NickHeiner
Copy link

I have the following field in my package.json:

  "repository": {
    "type": "git",
    "url": "ssh://git@stash.corp.netflix.com:7999/t2/tvui.git"
  },

When I run remark, I get the following error:

λ remark -u validate-links .

tools/tvui-tools-update-edge-scripts/README.md
  1:1  error  Error: remark-validate-links cannot parse `repository` (`ssh://git@stash.corp.netflix.com:7999/t2/tvui.git`)

That error is repeated at location 1:1 of every one of my 158 markdown files in this repo. It's a bit misleading to suggest that the error is with the markdown itself, and not with the config passed in. There should only be one error displayed to the user, before any files are checked.

But more pressingly, this issue blocks me from using this tool. I can't remove the repository field from package.json, because other tools rely on it. But if I pass a falsey value for --use 'validate-links=repository:', the code reads from the package.json anyway.

I need a flag to say something like --ignore-repository. I'm happy to just forgo repository functionality and rely only on local checking.

Thanks!

@wooorm
Copy link
Member

wooorm commented Jan 5, 2019

Hmm, this plugin strongly expects the files you’re processing to be part of a GitHub/Bitbucket/GitLab repository. Much of the file/path resolving is based on that.

Could you try passing in repository: t2/tvui, would something like that work?

@wooorm
Copy link
Member

wooorm commented Jan 8, 2019

@NickHeiner Ping!

@NickHeiner
Copy link
Author

Hi. Thanks for the follow-up. I was on vacation, so I didn't see this until now.

I'm a little surprised that passing a repository is necessary, because:

  1. The docs make it sound optional:

    When a repository is given or detected (supporting GitHub, GitLab, and Bitbucket), links to the files are normalized to the file-system.

  2. Knowing the repository shouldn't be necessary to validate that local links (e.g. [foo](./foo.md)) are valid.

I suspect that passing t2/tvui would not work, because then the tool would assume that it's on GH.

Is there no mode that just ignores links to the files on the remote web host? (e.g. https://github.com/org/repo/blob/file.md)

@wooorm wooorm closed this as completed in 0c45387 Jun 23, 2019
wooorm added a commit that referenced this issue Jun 23, 2019
* Use async file system operations
* Check definitions, not references
* Get repo info from Git instead of `package.json`, supporting non-npm projects
* Support checking files on the API
* Support non-hosted Git repos
* Support self-hosted Git repos
* Support case-insensitive hashes
* Support streaming
* Support multiple Git repos
* Supports Gists
* Add many more tests

Closes GH-28.
Closes GH-39.
Closes GH-41.
@wooorm wooorm added the 🙋 no/question This does not need any changes label Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙋 no/question This does not need any changes
Development

No branches or pull requests

2 participants