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
32 changes: 26 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,42 @@
This is Exercism's automated analyzer for the Python track exercises.
It is based on and uses [PyLint][pylint-github].

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`.
It is run from a docker container using `./bin/run-in-docker.sh <exercise-slug> <path/to/solution/files/> <path/for/output/file/>`.
It will read the source code from `<path/to/solution/files/>` and write a `.json` file with an analysis to `<path/for/output/file/>`.
Please note `<path/to/solution/files/>` & `<path/for/output/file/>` need to be **_relative_** to the location of this repo in your environment.

For example:
For example, from the `python-analyzer/` (project root) directory:

```bash
./bin/run-in-docker.sh two_fer ~/solution-238382y7sds7fsadfasj23j/ ~/solution-238382y7sds7fsadfasj23j/output/
```

Unit tests also require [docker][docker] and can be run locally or from within GitHub via [codespaces][codespaces]:
Or if you also have the Python content repo cloned alongside this repo and have a solution saved in the stub file.
From the `python-analyzer/` (project root) directory you can run:

```bash

#run from the python-analyzer (project root) directory.
./bin/run-tests-in-docker.sh
./bin/run-in-docker.sh two_fer ../python/exercises/practice/two-fer/ ../python/exercises/practice/two-fer/
```


## Running the Tests for the Analyzer

Unit tests require [docker][docker] and can be run locally or from within GitHub via [codespaces][codespaces]:

1. Build the analyzer image from the Dockerfile
2. Open a terminal in the root of your copy/local copy of this project.
3. From the `python-analyzer/` (project root) directory run:
```bash
./bin/run-tests-in-docker.sh
```


> [!NOTE]
> 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.
>
> For more details, see [PyLint message control](https://pylint.pycqa.org/en/latest/user_guide/messages/message_control.html#block-disables).


[pylint-github]: https://github.com/pylint-dev/pylint
[docker]: https://www.docker.com/
[codespaces]: https://github.com/features/codespaces
2 changes: 1 addition & 1 deletion lib/common/pylint_data/messages/disallowed-name/bad.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ def foo(): # [disallowed-name]

x = 15 # [disallowed-name]
y = 12 # [disallowed-name]
result = x + y
result = x + y