| 
									
										
										
										
											2024-06-13 09:41:31 +01:00
										 |  |  | # typed: true | 
					
						
							|  |  |  | # frozen_string_literal: true | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | rule "HB034", "Bare unstyled URL used" do | 
					
						
							| 
									
										
										
										
											2021-12-02 13:52:27 -05:00
										 |  |  |   tags :links, :url | 
					
						
							| 
									
										
										
										
											2024-06-13 09:41:31 +01:00
										 |  |  |   aliases "no-bare-unstyled-urls" | 
					
						
							| 
									
										
										
										
											2021-12-02 13:52:27 -05:00
										 |  |  |   check do |doc| | 
					
						
							|  |  |  |     doc.matching_text_element_lines(%r{(?<=\s)https?://}) | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end | 
					
						
							| 
									
										
										
										
											2025-05-22 10:40:58 -04:00
										 |  |  | rule "HB100", "Full URL for internal link used" do | 
					
						
							|  |  |  |   tags :links, :url | 
					
						
							|  |  |  |   aliases "no-full-urls-for-internal-links" | 
					
						
							|  |  |  |   check do |doc| | 
					
						
							|  |  |  |     doc.matching_lines(%r{\]\(https://docs.brew.sh/.+?\)}) | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end | 
					
						
							|  |  |  | rule "HB101", "File extension missing from internal link" do | 
					
						
							|  |  |  |   tags :links, :url | 
					
						
							|  |  |  |   aliases "file-extension-required-for-internal-links" | 
					
						
							|  |  |  |   check do |doc| | 
					
						
							|  |  |  |     doc.matching_lines(/\]\((?!#|\w+:)(?>[^#.)]+)(?!\.\w+)/) | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |