Skip to content

Commit

Permalink
[MegaLinter] Apply linters fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bdovaz committed Feb 10, 2023
1 parent b2c6977 commit a39a07c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions .automation/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1895,6 +1895,7 @@ def get_install_md(item):
)
return linter_doc_md


def doc_url(href):
if (
"/descriptors/" in href
Expand Down Expand Up @@ -2013,23 +2014,26 @@ def merge_install_attr(item):
else:
item["install"][elt] = elt_val + item["install"][elt]


def md_package_list(package_list, type, indent, start_url):
res = []
for package_id_v in package_list:
package_id = package_id_v
package_version = ""

if type == "npm" and package_id.count("@") == 2: # npm specific version
if type == "npm" and package_id.count("@") == 2: # npm specific version
package_id_split = package_id.split("@")
package_id = "@" + package_id_split[1]
package_version = "/v/" + package_id_split[2]
elif type == "pip" and "==" in package_id_v: # py specific version
elif type == "pip" and "==" in package_id_v: # py specific version
package_id = package_id_v.split("==")[0]
package_version = "/" + package_id_v.split("==")[1]
elif type == "gem":
gem_match=re.match(r"(.*)\s-v\s(.*)", package_id_v) # gem specific version
gem_match = re.match(
r"(.*)\s-v\s(.*)", package_id_v
) # gem specific version

if gem_match: # gem specific version
if gem_match: # gem specific version
package_id = gem_match.group(1)
package_version = "/versions/" + gem_match.group(2)
res += [f"{indent}- [{package_id_v}]({start_url}{package_id}{package_version})"]
Expand Down
2 changes: 1 addition & 1 deletion docs/descriptors/xml_xmllint.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To apply file formatting you must set `XML_XMLLINT_CLI_LINT_MODE: file` and `XML
| Variable | Description | Default value |
|-----------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|
| XML_XMLLINT_AUTOFORMAT | If set to `true`, it will reformat and reindent the output | `false` |
| XML_XMLLINT_INDENT | The number of indentation spaces when `XML_XMLLINT_AUTOFORMAT` is `true` | ` ` |
| XML_XMLLINT_INDENT | The number of indentation spaces when `XML_XMLLINT_AUTOFORMAT` is `true` | `` |
| XML_XMLLINT_ARGUMENTS | User custom arguments to add in linter CLI call<br/>Ex: `-s --foo "bar"` | |
| XML_XMLLINT_FILTER_REGEX_INCLUDE | Custom regex including filter<br/>Ex: `(src\|lib)` | Include every file |
| XML_XMLLINT_FILTER_REGEX_EXCLUDE | Custom regex excluding filter<br/>Ex: `(test\|examples)` | Exclude no file |
Expand Down

0 comments on commit a39a07c

Please sign in to comment.