Skip to content

Commit

Permalink
Delete checkstyle sources (#134)
Browse files Browse the repository at this point in the history
* Delete checkstyle sources

* Fix curl command
  • Loading branch information
nbirillo authored Sep 13, 2021
1 parent b1d792f commit dfaa3d9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ RUN pip install --no-cache-dir \
./review

ENV LINTERS_DIRECTORY /opt/linters

ENV CHECKSTYLE_VERSION 8.44
ENV CHECKSTYLE_DIRECTORY ${LINTERS_DIRECTORY}/checkstyle

ENV DETEKT_VERSION 1.14.2
Expand All @@ -29,4 +31,7 @@ RUN curl -sSLO https://github.com/detekt/detekt/releases/download/v${DETEKT_VERS
&& unzip detekt-cli-${DETEKT_VERSION}.zip -d ${DETEKT_DIRECTORY} \
&& curl -H "Accept: application/zip" https://repo.maven.apache.org/maven2/io/gitlab/arturbosch/detekt/detekt-formatting/${DETEKT_VERSION}/detekt-formatting-${DETEKT_VERSION}.jar -o ${DETEKT_DIRECTORY}/detekt-formatting-${DETEKT_VERSION}.jar

# Install Checkstyle
RUN curl -L https://github.com/checkstyle/checkstyle/releases/download/checkstyle-${CHECKSTYLE_VERSION}/checkstyle-${CHECKSTYLE_VERSION}-all.jar > ${CHECKSTYLE_DIRECTORY}/checkstyle-${CHECKSTYLE_VERSION}-all.jar

CMD ["/bin/bash"]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The source code of **hyperstyle** is distributed under the Apache 2.0 License.

The 3rd party software we use in this project has its own licenses.

Python language:
Python language (all versions can be found in the (requirements.txt)[requirements.txt] file):

- [x] flake8 [MIT]
* [Site and docs](https://flake8.pycqa.org/en/latest/)
Expand All @@ -40,11 +40,11 @@ Python language:

Java language:

- [x] PMD [BSD]
- [x] PMD [BSD]
* [Site and docs](https://pmd.github.io/)
* [Repository](https://github.com/pmd/pmd)

- [x] Checkstyle [GNU LGPL v2.1] (Version: 6.36.0)
- [x] Checkstyle [GNU LGPL v2.1] (Version: 8.44)
* [Site and docs](https://checkstyle.sourceforge.io/)
* [Repository](https://github.com/checkstyle/checkstyle)

Expand Down
13 changes: 10 additions & 3 deletions src/python/review/inspectors/checkstyle/checkstyle.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import logging
import os
from pathlib import Path
from typing import Any, Dict, List

from src.python.review.common.file_system import new_temp_dir
from src.python.review.common.file_system import check_set_up_env_variable, new_temp_dir
from src.python.review.common.subprocess_runner import run_in_subprocess
from src.python.review.inspectors.base_inspector import BaseInspector
from src.python.review.inspectors.checkstyle.issue_types import CHECK_CLASS_NAME_TO_ISSUE_TYPE
Expand All @@ -12,8 +13,14 @@

logger = logging.getLogger(__name__)

CHECKSTYLE_DIRECTORY_ENV = 'CHECKSTYLE_DIRECTORY'
check_set_up_env_variable(CHECKSTYLE_DIRECTORY_ENV)
CHECKSTYLE_VERSION_ENV = 'CHECKSTYLE_VERSION'
check_set_up_env_variable(CHECKSTYLE_VERSION_ENV)

PATH_CHECKSTYLE_JAR = f'{os.environ[CHECKSTYLE_DIRECTORY_ENV]}/checkstyle-{os.environ[CHECKSTYLE_VERSION_ENV]}-all.jar'

PATH_TOOLS_PMD_FILES = Path(__file__).parent / 'files'
PATH_TOOLS_CHECKSTYLE_JAR = PATH_TOOLS_PMD_FILES / 'checkstyle.jar'
PATH_TOOLS_CHECKSTYLE_CONFIG = PATH_TOOLS_PMD_FILES / 'config.xml'


Expand All @@ -37,7 +44,7 @@ class CheckstyleInspector(BaseInspector):
@classmethod
def _create_command(cls, path: Path, output_path: Path) -> List[str]:
return [
'java', '-jar', PATH_TOOLS_CHECKSTYLE_JAR,
'java', '-jar', PATH_CHECKSTYLE_JAR,
'-c', PATH_TOOLS_CHECKSTYLE_CONFIG,
'-f', 'xml', '-o', output_path, str(path),
]
Expand Down
Binary file not shown.

0 comments on commit dfaa3d9

Please sign in to comment.