Skip to content

[Yaml] fix the displayed line number #23332

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

Merged
merged 2 commits into from
Jun 30, 2017
Merged

[Yaml] fix the displayed line number #23332

merged 2 commits into from
Jun 30, 2017

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Jun 30, 2017

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #23294
License MIT
Doc PR

First, this PR backports #23294 to the 3.4 branch.

Secondly, getRealCurrentLineNb() returns line numbers index by 0 (as they serve as array indexes internally). I removed the getLastLineNumberBeforeDeprecation() method added in #23294 as we can just expose the already existing getRealCurrentLineNb() method.

fabpot and others added 2 commits June 30, 2017 11:07
…WybrenKoelmans)

This PR was merged into the 4.0-dev branch.

Discussion
----------

[Yaml][Lint] Add line numbers to JSON output.

| Q             | A
| ------------- | ---
| Branch?       | 2.7?
| Bug fix?      | no?
| New feature?  | yes?
| BC breaks?    | no?
| Deprecations? | no?
| Tests pass?   | Hopefully
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | TODO?

- [ ] Run tests?
- [ ] Check if it will break BC?
- [ ] Update changelog?

The JSON output is not very useful for me without the line number. I don't want to have to parse it from the message.

Is this the right way of doing it?

With PR:
```
[
    {
        "file": "",
        "line": 13,
        "valid": false,
        "message": "Unable to parse at line 13 (near \"sdf \")."
    }
]
```

Before:
```
[
    {
        "file": "",
        "valid": false,
        "message": "Unable to parse at line 13 (near \"sdf \")."
    }
]
```

Commits
-------

c6d19b1 [Yaml][Twig][Lint] Added line numbers to JSON output.
`getRealCurrentLineNb()` returns line numbers index by 0 (as they serve
as array indexes internally).
@xabbuh xabbuh added this to the 3.4 milestone Jun 30, 2017
@fabpot fabpot merged commit a2ae6bf into symfony:3.4 Jun 30, 2017
fabpot added a commit that referenced this pull request Jun 30, 2017
This PR was merged into the 3.4 branch.

Discussion
----------

[Yaml] fix the displayed line number

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #23294
| License       | MIT
| Doc PR        |

First, this PR backports #23294 to the `3.4` branch.

Secondly, `getRealCurrentLineNb()` returns line numbers index by 0 (as they serve as array indexes internally). I removed the `getLastLineNumberBeforeDeprecation()` method added in #23294 as we can just expose the already existing `getRealCurrentLineNb()` method.

Commits
-------

a2ae6bf [Yaml] fix the displayed line number
1baac5a feature #23294 [Yaml][Lint] Add line numbers to JSON output. (WybrenKoelmans)
@xabbuh xabbuh deleted the pr-23294 branch June 30, 2017 12:30
This was referenced Oct 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants