biomejs / biome

A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.
https://biomejs.dev
Apache License 2.0
15.3k stars 475 forks source link

📝 The flag log-kind doesn't change the output format in 1.5.3 #1701

Closed jschaf closed 9 months ago

jschaf commented 9 months ago

Environment information

CLI:
  Version:                      1.5.3
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v21.5.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "npm/10.2.4"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    true
  VCS disabled:                 false

Workspace:
  Open Documents:               0

Configuration

{
  "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
  "files": {
    "ignore": ["*.pb.ts", "erp/app/dist", ".gitignore", "baseline.sarif.json"],
    "ignoreUnknown": true
  },
  "vcs": {
    "clientKind": "git",
    "enabled": true,
    "useIgnoreFile": true,
    "defaultBranch": "main"
  },
  "formatter": {
    "ignore": ["*.pb.ts", "pos/domain/*.json", "erp/app/dist", "google/**"],
    "indentWidth": 2,
    "indentStyle": "space"
  },
  "javascript": {
    "formatter": {
      "quoteStyle": "single",
      "lineWidth": 100,
      "bracketSameLine": true
    }
  },
  "linter": {
    "enabled": true,
    "ignore": ["*.pb.ts"],
    "rules": {
      "complexity": {
        "noStaticOnlyClass": "off",
        "noForEach": "off"
      },
      "correctness": {
        "noUnusedVariables": "error"
      },
      "style": {
        "noUnusedTemplateLiteral": "off",
        "noParameterAssign": "off"
      },
      "suspicious": {
        "noConfusingVoidType": "off"
      }
    }
  },
  "organizeImports": {
    "enabled": false
  }
}

Playground link

https://biomejs.dev/playground/?lineWidth=120&code=YwBvAG4AcwB0ACAAZgBvAG8AIAA9ACAAIgAxADIAMwA0ACIAIAA7AA%3D%3D

Code of Conduct

Repro

These invocations all show the same output pretty:

npx biome format --log-kind=compact .
npx biome format --log-kind=pretty .
npx biome format --log-kind=json .
ematipico commented 9 months ago

That's not a formatting issue, that option is available to all commands.

Could you at least share some screenshots, please? Or video. We don't need a playground

jschaf commented 9 months ago

That's not a formatting issue, that option is available to all commands.

I wasn't sure how to categorize global options.

Could you at least share some screenshots, please? Or video. We don't need a playground

Sure:

Screenshot 2024-01-30 at 12 49 17 PM
ematipico commented 9 months ago

You have to not enabled logging.

What you see on screen are diagnostics. Logs are different. Use --log-kind=info to enable logs up to info kind.

Hookyns commented 9 months ago

So, are there any options to change the diagnostics format?

When used in git hooks, IDEs show output usually in small pop-up windows. I'd like to see something like: "There are 20 errors in 6 files." or list of files with errors; something compact.

ematipico commented 9 months ago

So, are there any options to change the diagnostics format?

No, not yet. I've done some preliminary work though

When used in git hooks, IDEs show output usually in small pop-up windows. I'd like to see something like: "There are 20 errors in 6 files." or list of files with errors; something compact.

I'm not sure what you are referring to. But if you have some idea, I suggest creating a GitHub discussion

ematipico commented 9 months ago

I'm going to close the issue. OP hasn't replied in a while, and it seems he misunderstood the issue

jschaf commented 8 months ago

To close the loop, what I'm really after is structured data of diagnostics as JSON or a similar format. I'd like to wrap Biome with our internal command-line tool to make linting a single command across all languages we support (Go, SQL, protobuf, and a few others)

What I want to do is:

 # Run linters for all supported languages in our repo, including biome.
some-internal-tool lint