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

Line numbers start at 1 #2804

Merged
merged 1 commit into from
Feb 13, 2025
Merged

Conversation

dnmfarrell
Copy link
Contributor

A quick (partial) fix the the singleton warning line number. See what you think!

Bumps the line number for the singleton warning. When the singleton occurs on the same line at the term starts, the line number is correct (e.g.line 1 instead of 0):

foo(X).

However it stills mis-reports this line number as 1 instead of 5:

foo(1) :-
    true,
    true,
    true,
    Y.

See issue #1356.

Comment on lines 24 to 25
.case("tests/scryer/cli/issues/*.toml")
.skip("tests/scryer/cli/issues/singleton_warning.toml") // wrong line number
.case("tests/scryer/cli/issues/singleton_warning.toml")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The skip can be removed without adding a new case as it should be covered by the glob above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we delete the associated files for that issue too?

$ find . -name 'singleton_warning*'
./tests/scryer/cli/issues/singleton_warning.stderr
./tests/scryer/cli/issues/singleton_warning.in
./tests/scryer/cli/issues/singleton_warning.stdin
./tests/scryer/cli/issues/singleton_warning.toml
./tests/scryer/cli/issues/singleton_warning.stdout

Copy link
Contributor

@bakaq bakaq Feb 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's rarely a good idea to delete tests. I suggest we keep them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks. I've removed the skip.

Bumps the line number for the singleton warning. When the singleton
occurs on the same line at the term starts, the line number is correct:

    foo(X).

However it stills mis-reports this line number as 1 instead of 5:

    foo(1) :-
        true,
        true,
        true,
        Y.

See issue mthom#1356.
@dnmfarrell dnmfarrell force-pushed the line-count-off-by-one branch from 2ca683c to f509d3d Compare February 2, 2025 13:16
@mthom mthom merged commit c77ea48 into mthom:master Feb 13, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants