Giter VIP home page Giter VIP logo

errata's People

Contributors

patriksvensson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

errata's Issues

Invalid offset

When adding a label to the last character of a file rendering will fail with an invalid offset error.

Assuming the following file:

---
Title: Home
---
# Foo
Bar

And the following label:

            report.AddDiagnostic(
                Diagnostic.Error("This will fail")
                    .WithLabel(new Label("Demo/Files/Example2.md", new Location(5, 3), "Issue on last character of the line")
                        .WithColor(Color.Yellow)
                        .WithLength(1)));

Output will be:

┌─Errata Error────────────────────────────────────────────┐
│ An error occured when rendering diagnostic              │
│ Error: Invalid offset                                   │
│                                                         │
│ If you belive this is a bug in Errata, please submit it │
│ at https://github.com/spectreconsole/errata/issues/new  │
└─────────────────────────────────────────────────────────┘

See pascalberger@d9926e1 for a repro

Rendering to a string?

I was looking for a way to render Reports to a string (accepting drawbacks like losing the colors, monospace font requirement for display, etc.), and it seems that this would require implementing a special IAnsiConsole.

Do this sound viable, or would expect problems? Or maybe there is already a way to do this that I just haven't found?

Thanks!

Mode to print errors to console instead of throwing

Errata is a good fit to print diagnostic information from another tool. Currently it will throw an exception as soon as something unexpected happens (file not found, label position out of range). There are cases where this can happen (e.g. error references state from memory not from disk). In the current version Errate will throw and stop rendering. It would be helpful to have a setting to enable a mode where such errors would be printed to the console instead of an exception being thrown

Spelling issue in footer

I think that you meant to use the word "believe" instead of "belive" in the footer.

This is what is shown in your tweet (September 5)
image

Handle long label messages better

Right now, we don't really care about how long a label message is or the line it references, but for some files, it might look strange and mess up the rendering of diagnostics. We should handle these scenarios better.

Support for line level labels

Labels can currently be created for a range or location consisting of line and column. It would be useful to have the possibility to create a label for a whole line. Currently this is possible by either set column to 1 or appropriate length or span if this information is available.

API could look like this:

report.AddDiagnostic(
	new Diagnostic("Fix formatting")
        .WithLabel(new Label("Example/Files/Program.cs", new Location(42), "Code should not contain trailing whitespace")
            .WithColor(Color.Yellow)));

Labels affecting a whole line can either by drawn across the whole line:

image

Or by marking the linke to the side:

image

Consider namespacing the examples dotnet tool

It would be nice to namespace the dotnet tool examples like dotnet-errata-examples to prevent possible collisions and make it clearer what it is (without having to look at the description field). Cheers!!

Support for file level diagnostic

Labels can currently be created for a range or location consisting of line and column inside a file. It would be useful to have the possibility to create labels for a whole file.

API could look like this:

report.AddDiagnostic(
	new Diagnostic("Fix formatting")
        .WithLabel(new Label("Example/Files/Program.cs", "Code should not contain trailing whitespace")
            .WithColor(Color.Yellow)));

Label affecting a whole file could look like this:

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.