mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-10-31 02:52:37 +00:00 
			
		
		
		
	languages/markdown: add markdownlint-cli2 support (#767)
	
		
			
	
		
	
	
		
	
		
			Some checks are pending
		
		
	
	
		
			
				
	
				Set up binary cache / cachix (default) (push) Waiting to run
				
			
		
			
				
	
				Set up binary cache / cachix (maximal) (push) Waiting to run
				
			
		
			
				
	
				Set up binary cache / cachix (nix) (push) Waiting to run
				
			
		
			
				
	
				Treewide Checks / Validate flake (push) Waiting to run
				
			
		
			
				
	
				Treewide Checks / Check formatting (push) Waiting to run
				
			
		
			
				
	
				Treewide Checks / Check source tree for typos (push) Waiting to run
				
			
		
			
				
	
				Treewide Checks / Validate documentation builds (push) Waiting to run
				
			
		
			
				
	
				Treewide Checks / Validate hyperlinks in documentation sources (push) Waiting to run
				
			
		
			
				
	
				Treewide Checks / Validate Editorconfig conformance (push) Waiting to run
				
			
		
			
				
	
				Build and deploy documentation / Check latest commit (push) Waiting to run
				
			
		
			
				
	
				Build and deploy documentation / publish (push) Blocked by required conditions
				
			
		
		
	
	
		
	
		
			Some checks are pending
		
		
	
	Set up binary cache / cachix (default) (push) Waiting to run
				
			Set up binary cache / cachix (maximal) (push) Waiting to run
				
			Set up binary cache / cachix (nix) (push) Waiting to run
				
			Treewide Checks / Validate flake (push) Waiting to run
				
			Treewide Checks / Check formatting (push) Waiting to run
				
			Treewide Checks / Check source tree for typos (push) Waiting to run
				
			Treewide Checks / Validate documentation builds (push) Waiting to run
				
			Treewide Checks / Validate hyperlinks in documentation sources (push) Waiting to run
				
			Treewide Checks / Validate Editorconfig conformance (push) Waiting to run
				
			Build and deploy documentation / Check latest commit (push) Waiting to run
				
			Build and deploy documentation / publish (push) Blocked by required conditions
				
			This commit is contained in:
		
					parent
					
						
							
								b92d9e7e26
							
						
					
				
			
			
				commit
				
					
						ed20d9d1bb
					
				
			
		
					 2 changed files with 28 additions and 1 deletions
				
			
		|  | @ -287,6 +287,7 @@ | ||||||
| [venkyr77](https://github.com/venkyr77): | [venkyr77](https://github.com/venkyr77): | ||||||
| 
 | 
 | ||||||
| - Add lint (luacheck) and formatting (stylua) support for Lua. | - Add lint (luacheck) and formatting (stylua) support for Lua. | ||||||
|  | - Add lint (markdownlint-cli2) support for Markdown. | ||||||
| 
 | 
 | ||||||
| [tebuevd](https://github.com/tebuevd): | [tebuevd](https://github.com/tebuevd): | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -11,7 +11,7 @@ | ||||||
|   inherit (lib.lists) isList; |   inherit (lib.lists) isList; | ||||||
|   inherit (lib.types) bool enum either package listOf str; |   inherit (lib.types) bool enum either package listOf str; | ||||||
|   inherit (lib.nvim.lua) expToLua toLuaObject; |   inherit (lib.nvim.lua) expToLua toLuaObject; | ||||||
|   inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption; |   inherit (lib.nvim.types) diagnostics mkGrammarOption mkPluginSetupOption; | ||||||
|   inherit (lib.nvim.dag) entryAnywhere; |   inherit (lib.nvim.dag) entryAnywhere; | ||||||
| 
 | 
 | ||||||
|   cfg = config.vim.languages.markdown; |   cfg = config.vim.languages.markdown; | ||||||
|  | @ -46,6 +46,12 @@ | ||||||
|       package = pkgs.prettierd; |       package = pkgs.prettierd; | ||||||
|     }; |     }; | ||||||
|   }; |   }; | ||||||
|  |   defaultDiagnosticsProvider = ["markdownlint-cli2"]; | ||||||
|  |   diagnosticsProviders = { | ||||||
|  |     markdownlint-cli2 = { | ||||||
|  |       package = pkgs.markdownlint-cli2; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
| in { | in { | ||||||
|   options.vim.languages.markdown = { |   options.vim.languages.markdown = { | ||||||
|     enable = mkEnableOption "Markdown markup language support"; |     enable = mkEnableOption "Markdown markup language support"; | ||||||
|  | @ -121,6 +127,15 @@ in { | ||||||
|         }; |         }; | ||||||
|       }; |       }; | ||||||
|     }; |     }; | ||||||
|  | 
 | ||||||
|  |     extraDiagnostics = { | ||||||
|  |       enable = mkEnableOption "extra Markdown diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;}; | ||||||
|  |       types = diagnostics { | ||||||
|  |         langDesc = "Markdown"; | ||||||
|  |         inherit diagnosticsProviders; | ||||||
|  |         inherit defaultDiagnosticsProvider; | ||||||
|  |       }; | ||||||
|  |     }; | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   config = mkIf cfg.enable (mkMerge [ |   config = mkIf cfg.enable (mkMerge [ | ||||||
|  | @ -155,5 +170,16 @@ in { | ||||||
|         require("render-markdown").setup(${toLuaObject cfg.extensions.render-markdown-nvim.setupOpts}) |         require("render-markdown").setup(${toLuaObject cfg.extensions.render-markdown-nvim.setupOpts}) | ||||||
|       ''; |       ''; | ||||||
|     }) |     }) | ||||||
|  | 
 | ||||||
|  |     (mkIf cfg.extraDiagnostics.enable { | ||||||
|  |       vim.diagnostics.nvim-lint = { | ||||||
|  |         enable = true; | ||||||
|  |         linters_by_ft.markdown = cfg.extraDiagnostics.types; | ||||||
|  |         linters = mkMerge (map (name: { | ||||||
|  |             ${name}.cmd = getExe diagnosticsProviders.${name}.package; | ||||||
|  |           }) | ||||||
|  |           cfg.extraDiagnostics.types); | ||||||
|  |       }; | ||||||
|  |     }) | ||||||
|   ]); |   ]); | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Venkatesan Ravi
				Venkatesan Ravi