Skip to content

Commit

Permalink
Use checksums for external linting tools
Browse files Browse the repository at this point in the history
* This updates detekt to 1.16.0 (from 1.1.1), and updates where it loads
  it from
* This checks the sha256 hash of the file against known correct values.
* This does NOT update ktlint. Newer ktlint versions expect globs, not
  absolute file paths, so it breaks on our list of absolute file paths.
  • Loading branch information
badboy committed May 4, 2021
1 parent 47a59d4 commit fdcb71d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ install: clean ## install the package to the active Python's site-packages
python setup.py install

install-kotlin-linters: ## install ktlint and detekt for linting Kotlin output
curl -sSLO https://github.com/shyiko/ktlint/releases/download/0.29.0/ktlint
test -f ktlint || curl -sSLO https://github.com/shyiko/ktlint/releases/download/0.29.0/ktlint
echo "03c9f9f78f80bcdb44c292d95e4d9abf221daf5e377673c1b6675a8003eab94d *ktlint" | sha256sum -c -
chmod a+x ktlint
curl -sSL --output "detekt-cli-1.1.1-all.jar" https://bintray.com/arturbosch/code-analysis/download_file?file_path=io%2Fgitlab%2Farturbosch%2Fdetekt%2Fdetekt-cli%2F1.1.1%2Fdetekt-cli-1.1.1-all.jar
test -f detekt-cli.jar || curl -sSL --output "detekt-cli.jar" https://github.com/detekt/detekt/releases/download/v1.16.0/detekt-cli-1.16.0-all.jar
echo "dd63aae60cce4b0516ffc11d31b6280d4010ab481754c7e49b2c9e78db877ca4 *detekt-cli.jar" | sha256sum -c -
7 changes: 1 addition & 6 deletions tests/test_kotlin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,8 @@
ROOT = Path(__file__).parent


# The version of Detekt built. Must match the version checked out in
# Makefile
DETEKT_VERSION = "1.1.1"


def run_detekt(files):
detekt_exec = ROOT.parent / f"detekt-cli-{DETEKT_VERSION}-all.jar"
detekt_exec = ROOT.parent / "detekt-cli.jar"
# We want to make sure this runs on CI, but it's not required
# for local development
if detekt_exec.is_file() or "CI" in os.environ:
Expand Down

0 comments on commit fdcb71d

Please sign in to comment.