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

bug: clang-format doesnt read config #370

Closed
1 task done
Kavci034 opened this issue Apr 12, 2024 · 1 comment
Closed
1 task done

bug: clang-format doesnt read config #370

Kavci034 opened this issue Apr 12, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Kavci034
Copy link

Kavci034 commented Apr 12, 2024

Neovim version (nvim -v)

nvim v0.9.5

Operating system/version

EndeavourOS

Add the debug logs

  • I have set log_level = vim.log.levels.DEBUG and pasted the log contents below.

Log file

Log file: /home/kavci034/.local/state/nvim/conform.log
additional information: expected '}'

      16:31:09[ERROR] Formatter 'stylua' error: error: could not format from stdin: failed to format from stdin: error parsing: error occurred while creating ast: unexpected token `:`. (starting from line 4, character 11 and ending on line 4, character 12)
      additional information: expected '}'
      
      16:31:12[ERROR] Formatter 'stylua' error: error: could not format from stdin: failed to format from stdin: error parsing: error occurred while creating ast: unexpected token `:`. (starting from line 4, character 11 and ending on line 4, character 12)
      additional information: expected '}'
      
      16:31:21[ERROR] Formatter 'stylua' error: error: could not format from stdin: failed to format from stdin: error parsing: error occurred while creating ast: unexpected token `=`. (starting from line 4, character 12 and ending on line 4, character 13)
      additional information: expected '}'

Describe the bug

clang-format doesnt use rules from .clang-format

What is the severity of this bug?

minor (annoyance)

Steps To Reproduce

  1. create a .clang-format file with some rules other than default
  2. create a file from the rules language
  3. format

Expected Behavior

clang-format uses the rules from the dotfile

Minimal example file

No response

Minimal init.lua

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  {
    "stevearc/conform.nvim",
    config = function()
      require("conform").setup({
        log_level = vim.log.levels.DEBUG,
        -- add your config here
      })
    end,
  },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

Additional context

No response

@Kavci034 Kavci034 added the bug Something isn't working label Apr 12, 2024
@Kavci034
Copy link
Author

I wrote the clang format wrong my bad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant