Giter VIP home page Giter VIP logo

Comments (5)

Sec-ant avatar Sec-ant commented on June 30, 2024 2

I think colors is the reason why the annotation doesn't work properly. Here is a working one I tested in my fork (not a fork, the website repo) with biome ci --reporter=github --colors=off using the v1.8.2 biome release, it correctly generated all the annotations.

from biome.

Sec-ant avatar Sec-ant commented on June 30, 2024 1

I think if Github annotations are going to be generated it might be better to force colours off as opposed to setting a flag to explicitly turn them off

I completely agree with you.

One thing is turning colours off also means that the colours for summary details/total are also off:

impl fmt::Display for SummaryDetail {
fn fmt(&self, fmt: &mut Formatter) -> io::Result<()> {
if self.0 > 0 {
fmt.write_markup(markup! {
" Fixed "{Files(self.0)}"."
})
} else {
fmt.write_markup(markup! {
" No fixes applied."
})
}
}
}
struct SummaryTotal<'a>(&'a TraversalMode, usize, &'a Duration);
impl<'a> fmt::Display for SummaryTotal<'a> {
fn fmt(&self, fmt: &mut Formatter) -> io::Result<()> {
let files = Files(self.1);
match self.0 {
TraversalMode::Check { .. } | TraversalMode::Lint { .. } | TraversalMode::CI { .. } => {
fmt.write_markup(markup! {
"Checked "{files}" in "{self.2}"."
})
}
TraversalMode::Format { write, .. } => {
if *write {
fmt.write_markup(markup! {
"Formatted "{files}" in "{self.2}"."
})
} else {
fmt.write_markup(markup! {
"Checked "{files}" in "{self.2}"."
})
}
}
TraversalMode::Migrate { write, .. } => {
if *write {
fmt.write_markup(markup! {
"Migrated your configuration file in "{self.2}"."
})
} else {
fmt.write_markup(markup! {
"Checked your configuration file in "{self.2}"."
})
}
}
TraversalMode::Search { .. } => fmt.write_markup(markup! {
"Searched "{files}" in "{self.2}"."
}),
}
}
}

This is not a big deal, but the ideal fix for this should be only switching off colours for the "annotation" part.

I'd like to reopen this as a reminder. Either forcing colours off entirely in this mode, or only keeping annotataions colorless is an acceptable fix.

from biome.

ematipico avatar ematipico commented on June 30, 2024 1

I'd like to reopen this as a reminder. Either forcing colours off entirely in this mode, or only keeping annotataions colorless is an acceptable fix.

I think removing colours based on the reporter is the way to go. Keeping annotation colourless feels too complex, and I don't envision future cases where we need such a sophisticated feature.

from biome.

ematipico avatar ematipico commented on June 30, 2024

Yeah I have been trying to understand why it hasn't been working properly, and I can't figure out why

from biome.

tommoyang avatar tommoyang commented on June 30, 2024

Tested, it's also working for me! Thanks for the fix.

I think if Github annotations are going to be generated it might be better to force colours off as opposed to setting a flag to explicitly turn them off, but i'm happy to leave that as just a note and close this issue.

from biome.

Related Issues (20)

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.