From baab041acde4232dbc525a0535ae495ad9da9f2b Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 30 Apr 2020 18:24:55 -0700 Subject: [PATCH] lint: Upgrade semgrep from 0.5.0-dev.2 to 0.5.0-dev.4. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The major PROVISION_VERSION bump would not be needed, but it was missing in commit 5ab62a3514e68651375f669ffb9be18e66ef396a (#14834), so I’m doing it here. Signed-off-by: Anders Kaseorg --- tools/lint | 1 + tools/setup/install-semgrep | 11 ++++++++--- version.py | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/lint b/tools/lint index 14429c1331..6995e19c62 100755 --- a/tools/lint +++ b/tools/lint @@ -91,6 +91,7 @@ def run() -> None: semgrep_command = ["semgrep", "--config=./tools/semgrep.yml", "--error"] linter_config.external_linter('semgrep-py', [*semgrep_command, "--lang=python"], ['py'], + fix_arg='--autofix', description="Syntactic Grep (semgrep) Code Search Tool " "(config: ./tools/semgrep.yml)") diff --git a/tools/setup/install-semgrep b/tools/setup/install-semgrep index 062c9247a2..94efa4bf49 100755 --- a/tools/setup/install-semgrep +++ b/tools/setup/install-semgrep @@ -1,9 +1,9 @@ #!/usr/bin/env bash set -e -version=0.5.0-dev.2 +version=0.5.0-dev.4 tarball=semgrep-v$version-ubuntu-16.04.tgz -sha256=3959f79b15c900d29567b6cb846831eb7da4c0a10969ffc98a1c9364ea377545 +sha256=0696104dd08f507e6f7de0f7dadc50b532e75bd082729243e1220a87d27c5a2d tarball_url=https://github.com/returntocorp/semgrep/releases/download/v$version/$tarball check_version () { @@ -16,7 +16,12 @@ if ! check_version; then cd "$tmpdir" wget -nv "$tarball_url" sha256sum -c <<< "$sha256 $tarball" - tar -xzf "$tarball" -C /usr/local/lib/ + tar -xzf "$tarball" -C /usr/local/lib/ semgrep-files/ ln -sf /usr/local/lib/semgrep-files/semgrep /usr/local/bin/semgrep ln -sf /usr/local/lib/semgrep-files/semgrep-core /usr/local/bin/semgrep-core + + # Clean old files from sgrep 0.4.9b5. + rm -rf /usr/local/lib/sgrep-lint-files /usr/local/bin/sgrep-lint /usr/local/bin/sgrep + + check_version fi diff --git a/version.py b/version.py index 10043eeb0d..d785789755 100644 --- a/version.py +++ b/version.py @@ -44,4 +44,4 @@ API_FEATURE_LEVEL = 2 # historical commits sharing the same major version, in which case a # minor version bump suffices. -PROVISION_VERSION = '81.4' +PROVISION_VERSION = '82.0'