Created
April 26, 2025 08:24
-
-
Save schnell18/03bab65bf41b080d4e4b9434b5bc977d to your computer and use it in GitHub Desktop.
Revisions
-
schnell18 created this gist
Apr 26, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ #!/usr/bin/env python import re import requests url = "https://raw.githubusercontent.com/rshkarin/mason-nvim-lint/910dadb99cb2bf0d5176026c7a4ab1861c4e561f/lua/mason-nvim-lint/mapping.lua" if __name__ == "__main__": try: # Send HTTP GET request to the URL response = requests.get(url) # Check if the request was successful if response.status_code == 200: # Split the content by newlines and return as a list j = 0 for i, line in enumerate(response.text.splitlines()): if i + 1 < 6 or i + 1 > 61: continue matcher = re.match(r'\s+\["(.*)"\] = "(.*)"', line) if matcher and matcher.group(1) != matcher.group(2): j += 1 print(f'{(i + 1):02d}: ["{matcher.group(1)}"] = {matcher.group(2)}') else: print(line) print(f"{j} out of {i + 1}") else: print(f"Failed to retrieve file. Status code: {response.status_code}") except Exception as e: print(f"An error occurred: {e}")