Skip to content

[BUG] Using ./ in paths #106

@dcastro

Description

@dcastro

Description

Both the --ignored and --root options misbehave when the filepath argument begins with ./.

The following command (when run against the project root) works fine:

$ xrefcheck --ignored tests/markdowns --root .

Configuration file not found, using default config for GitHub repositories

All repository links are valid.

But these commands don't:

$ xrefcheck --ignored tests/markdowns --root ./
$ xrefcheck --ignored ./tests/markdowns --root .

Note: this bug may or may not be related to #90. Once one of the two bugs is fixed, we should try to reproduce the other one and see if it has been fixed as well.

To Reproduce

Run these commands against the xrefcheck project's root:

$ xrefcheck --ignored tests/markdowns --root ./

xrefcheck --ignored tests/markdowns --root ./
Configuration file not found, using default config for GitHub repositories

=== Invalid references found ===                                                                                                                                                         

  ➥  In file ././.github/pull_request_template.md
     bad reference (absolute) at src:48:33-66:
       - text: "style guide"
       - link: /docs/code-style.md
       - anchor: -
     
     ⛀  File does not exist:
        .//docs/code-style.md
     
     
Invalid references dumped, 1 in total.
$ xrefcheck --ignored ./tests/markdowns --root .
Configuration file not found, using default config for GitHub repositories

Error when scanning ./tests/markdowns/with-annotations/unexpected_ignore_file.md: "ignore file" must be at the top of markdown or right after comments at the top(11:1-20)

Expected behavior

Expected both commands to behave similarly to xrefcheck --ignored tests/markdowns --root . and not return any errors.

Environment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions