Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 8 additions & 30 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,56 +10,34 @@ jobs:
container: stepik/hyperstyle-base:py3.8.11-java11.0.11-node14.17.3

steps:
- name: Install git
run: |
apt-get update
apt-get -y install git

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v1

- name: Install requirements
run: |
pip install --no-cache-dir -r requirements-test.txt -r requirements.txt

- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=.git,__pycache__,docs/source/conf.py,old,build,dist,venv,test/resources,.eggs,review.egg-info,.pytest_cache,node_modules
# TODO: change max-complexity into 10 after refactoring
# TODO: remove R504, A003, E800, E402, WPS1, WPS2, WPS3, WPS4, WPS5, WPS6, H601
flake8 . --count --max-complexity=11 --max-line-length=120 --max-doc-length=120 --ignore=R504,A003,E800,E402,W503,WPS1,WPS2,WPS3,WPS4,WPS5,WPS6,H601 --statistics --exclude=.git,__pycache__,docs/source/conf.py,old,build,dist,venv,test/resources,.eggs,review.egg-info,.pytest_cache,node_modules

- name: Sort whitelists
run: |
for file in "whitelist.txt" "src/python/review/inspectors/flake8/whitelist.txt"
do
LC_ALL=C sort $file -o $file
done

- name: Commit sorted whitelists
uses: EndBug/add-and-commit@v7.2.1
with:
add: "['whitelist.txt', 'src/python/review/inspectors/flake8/whitelist.txt']"
message: 'Sort whitelists (Github Actions)'

flake8 . --count --max-complexity=11 --max-line-length=120 --max-doc-length=120 --ignore=R504,A003,E800,E402,W503,WPS,H601 --statistics --exclude=.git,__pycache__,docs/source/conf.py,old,build,dist,venv,test/resources,.eggs,review.egg-info,.pytest_cache,node_modules
- name: Set up Eslint
run: |
# Consistent with eslint version in Dockerfile
npm install eslint@7.5.0 -g && eslint --init

- name: Test with pytest
run: |
pytest

- name: Install review module
run: |
pip install .
- name: Check installed module can run python linters
run: |
python src/python/review/run_tool.py setup.py

review setup.py
- name: Check installed module can run java linters
run: |
python src/python/review/run_tool.py test/resources/inspectors/java/test_algorithm_with_scanner.java

review test/resources/inspectors/java/test_algorithm_with_scanner.java
- name: Check installed module can run js linters
run: |
python src/python/review/run_tool.py test/resources/inspectors/js/case0_no_issues.js
review test/resources/inspectors/js/case0_no_issues.js
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ Simply clone the repository and run the following commands:

1. `pip install -r requirements.txt`
2. `pip install -r requirements-test.txt` for tests
3. `pip install -r requirements-evaluation.txt` for evaluation

## Usage

Expand Down
39 changes: 0 additions & 39 deletions docker/dev/Dockerfile

This file was deleted.

1 change: 0 additions & 1 deletion requirements-evaluation.txt

This file was deleted.

6 changes: 0 additions & 6 deletions requirements-roberta.txt

This file was deleted.

11 changes: 8 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,15 @@ def get_inspectors_additional_files() -> List[str]:
return result


def get_requires() -> List[str]:
with open(current_dir / 'requirements.txt') as requirements_file:
return requirements_file.read().split('\n')


setup(
name='review',
name='hyperstyle',
version=get_version(),
description='review',
description='A tool for running a set of pre-configured linters and evaluating code quality.',
long_description=get_long_description(),
long_description_content_type='text/markdown',
url='https://github.com/hyperskill/hyperstyle',
Expand All @@ -47,7 +52,7 @@ def get_inspectors_additional_files() -> List[str]:
],
keywords='code review',
python_requires='>=3.8, <4',
install_requires=['upsourceapi'],
install_requires=get_requires(),
packages=find_packages(exclude=[
'*.unit_tests',
'*.unit_tests.*',
Expand Down
20 changes: 0 additions & 20 deletions src/python/common/tool_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from enum import Enum, unique
from typing import List, Optional

from src.python.evaluation.common.util import ColumnName
from src.python.review.application_config import LanguageVersion
from src.python.review.inspectors.inspector_type import InspectorType

Expand Down Expand Up @@ -84,22 +83,3 @@ class RunToolArgument(Enum):

GROUP_BY_DIFFICULTY = ArgumentsInfo(None, '--group-by-difficulty',
'With this flag, the final grade will be grouped by the issue difficulty.')

SOLUTIONS_FILE_PATH = ArgumentsInfo(None, 'solutions_file_path',
'Local XLSX-file or CSV-file path. '
'Your file must include column-names: '
f'"{ColumnName.CODE.value}" and '
f'"{ColumnName.LANG.value}". Acceptable values for '
f'"{ColumnName.LANG.value}" column are: '
f'{LanguageVersion.PYTHON_3.value}, {LanguageVersion.JAVA_8.value}, '
f'{LanguageVersion.JAVA_11.value}, {LanguageVersion.KOTLIN.value}.')

DIFFS_FILE_PATH = ArgumentsInfo(None, 'diffs_file_path',
'Path to a file with serialized diffs that were founded by diffs_between_df.py')

QODANA_SOLUTIONS_FILE_PATH = ArgumentsInfo(None, 'solutions_file_path',
'Csv file with solutions. This file must be graded by Qodana.')

QODANA_INSPECTIONS_PATH = ArgumentsInfo(None, 'inspections_path', 'Path to a CSV file with inspections list.')

QODANA_DUPLICATES = ArgumentsInfo(None, '--remove-duplicates', 'Remove duplicates around inspections')
36 changes: 0 additions & 36 deletions src/python/evaluation/README.md

This file was deleted.

Empty file removed src/python/evaluation/__init__.py
Empty file.
Empty file.
13 changes: 0 additions & 13 deletions src/python/evaluation/common/csv_util.py

This file was deleted.

107 changes: 0 additions & 107 deletions src/python/evaluation/common/pandas_util.py

This file was deleted.

53 changes: 0 additions & 53 deletions src/python/evaluation/common/util.py

This file was deleted.

Loading