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

Linting m3u8 files like proc_macros? #45

Open
Luro02 opened this issue Jan 28, 2020 · 3 comments
Open

Linting m3u8 files like proc_macros? #45

Luro02 opened this issue Jan 28, 2020 · 3 comments
Assignees
Labels
T-enhancement Type: enhancement. New feature or request
Milestone

Comments

@Luro02
Copy link
Collaborator

Luro02 commented Jan 28, 2020

I think I read somewhere, that Spans can work with arbitrary file formats and it is not limited to rust code. It would be cool to have an error, that when displayed does include the relevant code;

error: the file has to start with #EXTM3U
 --> tests/example.m3u8:1:1
  |
1 | #EXTM2U
  | ^^^^^^^
  |
@Luro02 Luro02 added the T-enhancement Type: enhancement. New feature or request label Jan 28, 2020
@Luro02 Luro02 added this to the 0.4 milestone Feb 3, 2020
@Luro02 Luro02 self-assigned this Feb 3, 2020
@Luro02
Copy link
Collaborator Author

Luro02 commented Feb 3, 2020

This is not possible afaik, because we do not want to emit the span as a compiler error and instead as a Spannable<String> that is attached to an error.

Therefore I started reimplementing the spanning as a separate crate, that will ideally be no_std and that supports to_string.

@Luro02 Luro02 mentioned this issue Feb 28, 2020
@Luro02
Copy link
Collaborator Author

Luro02 commented Mar 7, 2020

I found 3 crates, which let you span m3u8 files:

@dholroyd
Copy link
Contributor

I would personally love to have span metadata (optionally?) for all parsed elements, not just from errors.

Motivation would be enabling code using this crate to support rendering diagnostics like:

error: the referenced media segment could not be retrieved
 --> http://media.example.com/example.m3u8:7:1
  | 
7 | second.ts
  | ^^^^^^^^^  HTTP 404
= note: 404 for URL http://media.example.com/second.ts

or

error: media segment duration descrepancy
 --> tests/example.m3u8:7:1
  | 
6 | #EXTINF:9.009,
            ^^^^^ manifest declared duration is 9.009
7 | second.ts
  | ^^^^^^^^^  but this segment's actual duration is 18.018

@Luro02 Luro02 added this to To Do in Version 0.4.0 Apr 18, 2020
@Luro02 Luro02 moved this from To Do to Planned in Version 0.4.0 Apr 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-enhancement Type: enhancement. New feature or request
Projects
Version 0.4.0
  
Planned
Development

No branches or pull requests

2 participants