Skip to content

Instantly share code, notes, and snippets.

@schnell18
Created April 26, 2025 08:24
Show Gist options
  • Save schnell18/03bab65bf41b080d4e4b9434b5bc977d to your computer and use it in GitHub Desktop.
Save schnell18/03bab65bf41b080d4e4b9434b5bc977d to your computer and use it in GitHub Desktop.
Find string difference
#!/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}")
@schnell18
Copy link
Author

This script identifies root cause of rshkarin/mason-nvim-lint#8 fixed by rshkarin/mason-nvim-lint#21

@schnell18
Copy link
Author

schnell18 commented Apr 26, 2025

Result of this script:

    ["actionlint"] = "actionlint",
    ["ansible_lint"] = "ansible-lint",
07: ["ansible_lint"] = ansible-lint
    ["buf_lint"] = "buf",
08: ["buf_lint"] = buf
    ["buildifier"] = "buildifier",
    ["cbfmt"] = "cbfmt",
    ["cfn_lint"] = "cfn-lint",
11: ["cfn_lint"] = cfn-lint
    ["checkstyle"] = "checkstyle",
    ["checkmake"] = "checkmake",
    ["clj_kondo"] = "clj-kondo",
14: ["clj_kondo"] = clj-kondo
    ["cmakelint"] = "cmakelint",
    ["codespell"] = "codespell",
    ["cpplint"] = "cpplint",
    ["cspell"] = "cspell",
    ["curlylint"] = "curlylint",
    ["djlint"] = "djlint",
    ["editorconfig-checker"] = "editorconfig-checker",
    ["erb_lint"] = "erb-lint",
22: ["erb_lint"] = erb-lint
    ["eslint_d"] = "eslint_d",
    ["flake8"] = "flake8",
    ["gdlint"] = "gdtoolkit",
25: ["gdlint"] = gdtoolkit
    ["golangcilint"] = "golangci-lint",
26: ["golangcilint"] = golangci-lint
    ["hadolint"] = "hadolint",
    ["htmlhint"] = "htmlhint",
    ["jsonlint"] = "jsonlint",
    ["ktlint"] = "ktlint",
    ["luacheck"] = "luacheck",
    ["markdownlint"] = "markdownlint",
    ["mypy"] = "mypy",
    ["oxlint"] = "oxlint",
    ["phpcs"] = "phpcs",
    ["phpmd"] = "phpmd",
    ["phpstan"] = "phpstan",
    ["proselint"] = "proselint",
    ["psalm"] = "psalm",
    ["pydocstyle"] = "pydocstyle",
    ["pylint"] = "pylint",
    ["revive"] = "revive",
    ["rstcheck"] = "rstcheck",
    ["rubocop"] = "rubocop",
    ["ruff"] = "ruff",
    ["selene"] = "selene",
    ["shellcheck"] = "shellcheck",
    ["shellharden"] = "shellharden",
    ["solhint"] = "solhint",
    ["sqlfluff"] = "sqlfluff",
    ["standardrb"] = "standardrb",
    ["stylelint"] = "stylelint",
    ["snyk_iac"] = "snyk",
53: ["snyk_iac"] = snyk
    ["tflint"] = "tflint",
    ["tfsec"] = "tfsec",
    ["trivy"] = "trivy",
    ["vale"] = "vale",
    ["vint"] = "vint",
    ["vulture"] = "vulture",
    ["write_good"] = "write-good",
60: ["write_good"] = write-good
    ["yamllint"] = "yamllint",
9 out of 66

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment