-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into aws-sdk-cpp-res
- Loading branch information
Showing
771 changed files
with
12,583 additions
and
5,156 deletions.
There are no files selected for viewing
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"problemMatcher": [ | ||
{ | ||
"owner": "recipe_linter_errors", | ||
"severity": "error", | ||
"pattern": [ | ||
{ | ||
"regexp": "(\\S+):(\\d+):(\\d+):\\s(E\\d+):\\s(.+)\\s\\((\\S+)\\)", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3, | ||
"message": 5, | ||
"code": 4 | ||
} | ||
] | ||
}, | ||
{ | ||
"owner": "recipe_linter_warnings", | ||
"severity": "warning", | ||
"pattern": [ | ||
{ | ||
"regexp": "(\\S+):(\\d+):(\\d+):\\s(W\\d+):\\s(.+)\\s\\((\\S+)\\)", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3, | ||
"message": 5, | ||
"code": 4 | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import os | ||
import yaml | ||
import requests | ||
import packaging.version | ||
import subprocess | ||
import platform | ||
import sys | ||
|
||
|
||
def main(pr): | ||
session = requests.session() | ||
session.headers = {} | ||
token = os.getenv("GH_TOKEN") | ||
if token: | ||
session.headers["Authorization"] = "token %s" % token | ||
|
||
session.headers["Accept"] = "application/vnd.github.v3+json" | ||
session.headers["User-Agent"] = "request" | ||
session.auth = None | ||
# if user and pw: | ||
# session.auth = requests.auth.HTTPBasicAuth(user, pw) | ||
|
||
github_server_url = os.getenv("GITHUB_SERVER_URL") | ||
github_repo = os.getenv("GITHUB_REPOSITORY") | ||
|
||
r = session.request("GET", f"{github_server_url}/{github_repo}/pull/{pr}.diff") | ||
r.raise_for_status() | ||
diff = r.text | ||
packages = set() | ||
for line in diff.split("\n"): | ||
if line.startswith("+++ b/recipes/") or line.startswith("--- a/recipes/"): | ||
parts = line.split("/") | ||
if len(parts) >= 5: | ||
packages.add(parts[2] + "/" + parts[3]) | ||
for line in packages: | ||
package = line.split("/")[0] | ||
version = None | ||
folder = line.split("/")[1] | ||
with open(os.path.join("recipes", package, "config.yml"), "r") as file: | ||
config = yaml.safe_load(file) | ||
for v in config["versions"]: | ||
if config["versions"][v]["folder"] != folder: | ||
continue | ||
try: | ||
if not version or packaging.version.Version(v) > packaging.version.Version(version): | ||
version = v | ||
except packaging.version.InvalidVersion: | ||
print("Error parsing version %s for package %s in pr %s" % (v, package, pr)) | ||
|
||
if version: | ||
shell = bool(platform.system() != "Windows") | ||
command = "conan export %s %s/%s@" % (os.path.join("recipes", package, folder), package, version) | ||
p = subprocess.run(command, shell=shell, check=False) | ||
|
||
if __name__ == "__main__": | ||
# execute only if run as a script | ||
main(sys.argv[1]) |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: run linters | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
env: | ||
CONAN_YAMLLINT_WERR: 1 | ||
CONAN_PYLINT_WERR: 1 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
hook: ["yaml_linter", "recipe_linter"] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2.2.2 | ||
with: | ||
python-version: "3.8" | ||
|
||
- run: "pip3 install conan yamllint packaging pylint==2.10.2 astroid" | ||
|
||
- name: install hook | ||
run: | | ||
conan config install https://github.com/conan-io/hooks.git | ||
conan config set hooks.${{ matrix.hook }} | ||
- name: run lint | ||
run: | | ||
echo "::add-matcher::.github/${{ matrix.hook }}.json" | ||
python3 .github/runlint.py ${{ github.event.pull_request.number }} |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"problemMatcher": [ | ||
{ | ||
"owner": "yaml_linter", | ||
"pattern": [ | ||
{ | ||
"regexp": "^\\[HOOK\\s-\\syaml_linter\\.py\\]\\spre_export\\(\\):\\s(.+):(\\d+):(\\d+):\\s\\[(\\S+)\\]\\s(.+)\\s\\((.+)\\)$", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3, | ||
"severity": 4, | ||
"message": 5, | ||
"code": 6 | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Oops, something went wrong.