|
3 | 3 | This is Exercism's automated analyzer for the Python track exercises. |
4 | 4 | It is based on and uses [PyLint][pylint-github]. |
5 | 5 |
|
6 | | -It is run from a docker container using `./bin/run-in-docker.sh $EXERCISM $PATH_TO_FILES $PATH_FOR_OUTPUT` and will read the source code from `$PATH_TO_FILES` and write a text file with an analysis to `$PATH_FOR_OUTPUT`. |
| 6 | +It is run from a docker container using `./bin/run-in-docker.sh <exercise-slug> <path/to/solution/files/> <path/for/output/file/>`. |
| 7 | +It will read the source code from `<path/to/solution/files/>` and write a `.json` file with an analysis to `<path/for/output/file/>`. |
| 8 | +Please note `<path/to/solution/files/>` & `<path/for/output/file/>` need to be **_relative_** to the location of this repo in your environment. |
7 | 9 |
|
8 | | -For example: |
| 10 | +For example, from the `python-analyzer/` (project root) directory: |
9 | 11 |
|
10 | 12 | ```bash |
11 | 13 | ./bin/run-in-docker.sh two_fer ~/solution-238382y7sds7fsadfasj23j/ ~/solution-238382y7sds7fsadfasj23j/output/ |
12 | 14 | ``` |
13 | 15 |
|
14 | | -Unit tests also require [docker][docker] and can be run locally or from within GitHub via [codespaces][codespaces]: |
| 16 | +Or if you also have the Python content repo cloned alongside this repo and have a solution saved in the stub file. |
| 17 | +From the `python-analyzer/` (project root) directory you can run: |
15 | 18 |
|
16 | 19 | ```bash |
17 | | - |
18 | | -#run from the python-analyzer (project root) directory. |
19 | | -./bin/run-tests-in-docker.sh |
| 20 | +./bin/run-in-docker.sh two_fer ../python/exercises/practice/two-fer/ ../python/exercises/practice/two-fer/ |
20 | 21 | ``` |
21 | 22 |
|
| 23 | + |
| 24 | +## Running the Tests for the Analyzer |
| 25 | + |
| 26 | +Unit tests require [docker][docker] and can be run locally or from within GitHub via [codespaces][codespaces]: |
| 27 | + |
| 28 | +1. Build the analyzer image from the Dockerfile |
| 29 | +2. Open a terminal in the root of your copy/local copy of this project. |
| 30 | +3. From the `python-analyzer/` (project root) directory run: |
| 31 | + ```bash |
| 32 | + ./bin/run-tests-in-docker.sh |
| 33 | + ``` |
| 34 | + |
| 35 | + |
| 36 | +> [!NOTE] |
| 37 | +> The PyLint portion of the Analyzer will respect the `# pylint: disable=<rule_id>`, `# pylint: disable-next=<rule_id>`, and `# pylint: disable=all` directives from within code files, but it is recommended that you use them sparingly. |
| 38 | +> |
| 39 | +> For more details, see [PyLint message control](https://pylint.pycqa.org/en/latest/user_guide/messages/message_control.html#block-disables). |
| 40 | + |
| 41 | + |
22 | 42 | [pylint-github]: https://github.com/pylint-dev/pylint |
23 | 43 | [docker]: https://www.docker.com/ |
24 | 44 | [codespaces]: https://github.com/features/codespaces |
0 commit comments