mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-10-31 02:52:37 +00:00 
			
		
		
		
	language/hcl: migrate to conform/nvim-lint
This commit is contained in:
		
					parent
					
						
							
								856b064a19
							
						
					
				
			
			
				commit
				
					
						b24999300b
					
				
			
		
					 1 changed files with 8 additions and 10 deletions
				
			
		|  | @ -6,6 +6,7 @@ | |||
| }: let | ||||
|   inherit (builtins) attrNames; | ||||
|   inherit (lib.options) mkEnableOption mkOption; | ||||
|   inherit (lib.meta) getExe; | ||||
|   inherit (lib.modules) mkIf mkMerge; | ||||
|   inherit (lib.types) package bool enum; | ||||
|   inherit (lib.nvim.types) mkGrammarOption; | ||||
|  | @ -30,14 +31,6 @@ | |||
|   formats = { | ||||
|     hclfmt = { | ||||
|       package = pkgs.hclfmt; | ||||
|       nullConfig = '' | ||||
|         table.insert( | ||||
|           ls_sources, | ||||
|           null_ls.builtins.formatting.hclfmt.with({ | ||||
|             command = "${lib.getExe cfg.format.package}", | ||||
|           }) | ||||
|         ) | ||||
|       ''; | ||||
|     }; | ||||
|   }; | ||||
| in { | ||||
|  | @ -110,8 +103,13 @@ in { | |||
|     }) | ||||
| 
 | ||||
|     (mkIf cfg.format.enable { | ||||
|       vim.lsp.null-ls.enable = true; | ||||
|       vim.lsp.null-ls.sources.hcl-format = formats.${cfg.format.type}.nullConfig; | ||||
|       vim.formatter.conform-nvim = { | ||||
|         enable = true; | ||||
|         setupOpts.formatters_by_ft.hcl = [cfg.format.type]; | ||||
|         setupOpts.formatters.${cfg.format.type} = { | ||||
|           command = getExe cfg.format.package; | ||||
|         }; | ||||
|       }; | ||||
|     }) | ||||
|   ]); | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ching Pei Yang
				Ching Pei Yang