mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-10-31 19:12:38 +00:00 
			
		
		
		
	language/go: migrate to conform/nvim-lint
This commit is contained in:
		
					parent
					
						
							
								6225dff47a
							
						
					
				
			
			
				commit
				
					
						856b064a19
					
				
			
		
					 1 changed files with 8 additions and 26 deletions
				
			
		|  | @ -38,36 +38,15 @@ | ||||||
|   formats = { |   formats = { | ||||||
|     gofmt = { |     gofmt = { | ||||||
|       package = pkgs.go; |       package = pkgs.go; | ||||||
|       nullConfig = '' |       config.command = "${cfg.format.package}/bin/gofmt"; | ||||||
|         table.insert( |  | ||||||
|           ls_sources, |  | ||||||
|           null_ls.builtins.formatting.gofmt.with({ |  | ||||||
|             command = "${cfg.format.package}/bin/gofmt", |  | ||||||
|           }) |  | ||||||
|         ) |  | ||||||
|       ''; |  | ||||||
|     }; |     }; | ||||||
|     gofumpt = { |     gofumpt = { | ||||||
|       package = pkgs.gofumpt; |       package = pkgs.gofumpt; | ||||||
|       nullConfig = '' |       config.command = getExe cfg.format.package; | ||||||
|         table.insert( |  | ||||||
|           ls_sources, |  | ||||||
|           null_ls.builtins.formatting.gofumpt.with({ |  | ||||||
|             command = "${cfg.format.package}/bin/gofumpt", |  | ||||||
|           }) |  | ||||||
|         ) |  | ||||||
|       ''; |  | ||||||
|     }; |     }; | ||||||
|     golines = { |     golines = { | ||||||
|       package = pkgs.golines; |       package = pkgs.golines; | ||||||
|       nullConfig = '' |       config.command = "${cfg.format.package}/bin/golines"; | ||||||
|         table.insert( |  | ||||||
|           ls_sources, |  | ||||||
|           null_ls.builtins.formatting.golines.with({ |  | ||||||
|             command = "${cfg.format.package}/bin/golines", |  | ||||||
|           }) |  | ||||||
|         ) |  | ||||||
|       ''; |  | ||||||
|     }; |     }; | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|  | @ -153,8 +132,11 @@ in { | ||||||
|     }) |     }) | ||||||
| 
 | 
 | ||||||
|     (mkIf cfg.format.enable { |     (mkIf cfg.format.enable { | ||||||
|       vim.lsp.null-ls.enable = true; |       vim.formatter.conform-nvim = { | ||||||
|       vim.lsp.null-ls.sources.go-format = formats.${cfg.format.type}.nullConfig; |         enable = true; | ||||||
|  |         setupOpts.formatters_by_ft.go = [cfg.format.type]; | ||||||
|  |         setupOpts.formatters.${cfg.format.type} = formats.${cfg.format.type}.config; | ||||||
|  |       }; | ||||||
|     }) |     }) | ||||||
| 
 | 
 | ||||||
|     (mkIf cfg.dap.enable { |     (mkIf cfg.dap.enable { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ching Pei Yang
				Ching Pei Yang