Skip to content

Commit

Permalink
[GSoC'23] - M1.4.1 - Migrating Lint checks to work under Docker setup (
Browse files Browse the repository at this point in the history
…oppia#18698)

* lints to work under docker

* lints to work under docker

* modified makefile for lint checks

* Update Makefile

---------

Co-authored-by: Shivkant Chauhan <[email protected]>
  • Loading branch information
Shivkant-Chauhan and Shivkant-Chauhan authored Sep 18, 2023
1 parent cbcb3bc commit 3cff980
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ logs.%: ## Shows the logs of the given docker service. Example: make logs.datast
restart.%: ## Restarts the given docker service. Example: make restart.datastore
docker compose restart $*

run_tests.lints: ## Runs the linter tests
docker compose run --no-deps --entrypoint "python -m scripts.linters.pre_commit_linter $(PYTHON_ARGS)" dev-server

run-backend-tests: ## [Not ready for use] Runs the backend tests
@echo "Run the backend test on the following module: $(RUN_ARGS)"
@echo "Not in use, under construction!"
1 change: 1 addition & 0 deletions docker/Dockerfile.backend
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ WORKDIR /
# Installing the pre-requisites libs and dependencies
RUN apt-get update -y && apt-get upgrade -y \
curl \
git \
npm \
openjdk-11-jre \
python2 \
Expand Down
7 changes: 5 additions & 2 deletions scripts/linters/pre_commit_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
# we migrate to Python 3.8.
from scripts import common # isort:skip pylint: disable=wrong-import-position

from core import feconf # isort:skip
from core import utils # isort:skip

# Install third party dependencies before proceeding.
Expand All @@ -81,7 +82,8 @@
from . import other_files_linter # isort:skip
from . import python_linter # isort:skip
from .. import concurrent_task_utils # isort:skip
from .. import install_third_party_libs # isort:skip
if not feconf.OPPIA_IS_DOCKERIZED:
from .. import install_third_party_libs # isort:skip

OTHER_SHARD_NAME = 'other'

Expand Down Expand Up @@ -637,7 +639,8 @@ def main(args: Optional[List[str]] = None) -> None:
namespace=namespace
)

install_third_party_libs.main()
if not feconf.OPPIA_IS_DOCKERIZED:
install_third_party_libs.main()

print('Starting Linter....')

Expand Down

0 comments on commit 3cff980

Please sign in to comment.