-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python/word-count: 4th iteration - new project structure
- Loading branch information
Showing
19 changed files
with
213 additions
and
199 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Binary file not shown.
6 changes: 3 additions & 3 deletions
6
python/wordcount/.coverage.xml → python/word-count/.coverage.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[pytest] | ||
pythonpath = . | ||
addopts = --doctest-modules | ||
markers = | ||
task: exercise task/step |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,203 @@ | ||
Running automated test file(s): | ||
|
||
|
||
=============================================================================== | ||
|
||
Running: pylint ./src | ||
|
||
------------------------------------------------------------------- | ||
Your code has been rated at 10.00/10 (previous run: 9.63/10, +0.37) | ||
|
||
|
||
real 0m0.954s | ||
user 0m0.865s | ||
sys 0m0.091s | ||
|
||
=============================================================================== | ||
|
||
Running: ruff check --ignore E501 ./src | ||
|
||
real 0m0.089s | ||
user 0m0.033s | ||
sys 0m0.060s | ||
|
||
=============================================================================== | ||
|
||
Running: pyright --stats ./src | ||
Found 2 source files | ||
pyright 1.1.347 | ||
0 errors, 0 warnings, 0 informations | ||
Completed in 0.611sec | ||
|
||
Analysis stats | ||
Total files parsed and bound: 22 | ||
Total files checked: 2 | ||
|
||
Timing stats | ||
Find Source Files: 0sec | ||
Read Source Files: 0sec | ||
Tokenize: 0.04sec | ||
Parse: 0.04sec | ||
Resolve Imports: 0.06sec | ||
Bind: 0.07sec | ||
Check: 0.08sec | ||
Detect Cycles: 0sec | ||
|
||
real 0m1.512s | ||
user 0m1.258s | ||
sys 0m0.181s | ||
|
||
=============================================================================== | ||
|
||
Running: bandit --verbose --recursive ./src | ||
[main] INFO profile include tests: None | ||
[main] INFO profile exclude tests: None | ||
[main] INFO cli include tests: None | ||
[main] INFO cli exclude tests: None | ||
[main] INFO running on Python 3.12.1 | ||
Run started:2024-01-17 05:51:31.087754 | ||
Files in scope (2): | ||
./src/word_count/__init__.py (score: {SEVERITY: 0, CONFIDENCE: 0}) | ||
./src/word_count/word_count.py (score: {SEVERITY: 0, CONFIDENCE: 0}) | ||
Files excluded (0): | ||
|
||
Test results: | ||
No issues identified. | ||
|
||
Code scanned: | ||
Total lines of code: 21 | ||
Total lines skipped (#nosec): 0 | ||
Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0 | ||
|
||
Run metrics: | ||
Total issues (by severity): | ||
Undefined: 0 | ||
Low: 0 | ||
Medium: 0 | ||
High: 0 | ||
Total issues (by confidence): | ||
Undefined: 0 | ||
Low: 0 | ||
Medium: 0 | ||
High: 0 | ||
Files skipped (0): | ||
|
||
real 0m0.297s | ||
user 0m0.235s | ||
sys 0m0.064s | ||
|
||
=============================================================================== | ||
|
||
Running: refurb ./src | ||
[94msrc/word_count/word_count.py[0m[90m:21:5[0m [33m[FURB184][0m[90m:[0m Assignment statement should be chained | ||
|
||
Run `refurb --explain ERR` to further explain an error. Use `--quiet` to silence this message | ||
|
||
real 0m1.176s | ||
user 0m1.085s | ||
sys 0m0.093s | ||
|
||
=============================================================================== | ||
|
||
python -m doctest -v ./src/word_count/__init__.py ./src/word_count/word_count.py | ||
1 items had no tests: | ||
__init__ | ||
0 tests in 1 items. | ||
0 passed and 0 failed. | ||
Test passed. | ||
2 items had no tests: | ||
word_count | ||
word_count.count_words | ||
0 tests in 2 items. | ||
0 passed and 0 failed. | ||
Test passed. | ||
|
||
real 0m0.111s | ||
user 0m0.056s | ||
sys 0m0.055s | ||
|
||
|
||
=============================================================================== | ||
|
||
==> .coveragerc <== | ||
[run] | ||
omit = __init__.py, *_test.py | ||
|
||
Running: PYTHONPATH=./src pytest --verbose --cov=. --cov-branch --cov-report=term-missing --cov-report=xml:.coverage.xml -p no:randomly ./test | ||
============================= test session starts ============================== | ||
platform linux -- Python 3.12.1, pytest-7.4.3, pluggy-1.3.0 -- /home/vpayno/.pyenv/versions/3.12.1/bin/python | ||
cachedir: .pytest_cache | ||
rootdir: /home/vpayno/git_vpayno/exercism-workspace/python/word-count | ||
configfile: pytest.ini | ||
plugins: anyio-4.2.0, libtmux-0.25.0, pylama-8.4.1, cov-4.1.0, datafiles-3.0.0, docker-2.0.1, subprocess-1.5.0, typeguard-4.1.5 | ||
collecting ... collected 17 items | ||
|
||
test/word_count_test.py::WordCountTest::test_alternating_word_separators_not_detected_as_a_word PASSED [ 5%] | ||
test/word_count_test.py::WordCountTest::test_count_one_of_each_word PASSED [ 11%] | ||
test/word_count_test.py::WordCountTest::test_count_one_word PASSED [ 17%] | ||
test/word_count_test.py::WordCountTest::test_handles_cramped_lists PASSED [ 23%] | ||
test/word_count_test.py::WordCountTest::test_handles_expanded_lists PASSED [ 29%] | ||
test/word_count_test.py::WordCountTest::test_ignore_punctuation PASSED [ 35%] | ||
test/word_count_test.py::WordCountTest::test_include_numbers PASSED [ 41%] | ||
test/word_count_test.py::WordCountTest::test_multiple_apostrophes_ignored PASSED [ 47%] | ||
test/word_count_test.py::WordCountTest::test_multiple_occurrences_of_a_word PASSED [ 52%] | ||
test/word_count_test.py::WordCountTest::test_multiple_spaces_not_detected_as_a_word PASSED [ 58%] | ||
test/word_count_test.py::WordCountTest::test_non_alphanumeric PASSED [ 64%] | ||
test/word_count_test.py::WordCountTest::test_normalize_case PASSED [ 70%] | ||
test/word_count_test.py::WordCountTest::test_quotation_for_word_with_apostrophe PASSED [ 76%] | ||
test/word_count_test.py::WordCountTest::test_substrings_from_the_beginning PASSED [ 82%] | ||
test/word_count_test.py::WordCountTest::test_tabs PASSED [ 88%] | ||
test/word_count_test.py::WordCountTest::test_with_apostrophes PASSED [ 94%] | ||
test/word_count_test.py::WordCountTest::test_with_quotations PASSED [100%] | ||
|
||
---------- coverage: platform linux, python 3.12.1-final-0 ----------- | ||
Name Stmts Miss Branch BrPart Cover Missing | ||
----------------------------------------------------------- | ||
word_count.py 16 0 6 0 100% | ||
----------------------------------------------------------- | ||
TOTAL 16 0 6 0 100% | ||
Coverage XML written to file .coverage.xml | ||
|
||
|
||
============================== 17 passed in 0.09s ============================== | ||
|
||
real 0m0.863s | ||
user 0m0.718s | ||
sys 0m0.143s | ||
|
||
=============================================================================== | ||
|
||
Running: coverage report --show-missing | ||
Name Stmts Miss Branch BrPart Cover Missing | ||
----------------------------------------------------------- | ||
word_count.py 16 0 6 0 100% | ||
----------------------------------------------------------- | ||
TOTAL 16 0 6 0 100% | ||
|
||
real 0m0.170s | ||
user 0m0.111s | ||
sys 0m0.061s | ||
|
||
=============================================================================== | ||
|
||
coverage annotate | ||
|
||
real 0m0.158s | ||
user 0m0.106s | ||
sys 0m0.054s | ||
|
||
tail -n 10000 ./*,cover | grep -E -C 3 '^> def |^! ' | ||
|
||
> def count_words(sentence: str) -> Dict[str, int]: | ||
> """Counts the number of times each word in a string is used. | ||
|
||
=============================================================================== | ||
|
||
Running: misspell ./src/word_count/__init__.py ./src/word_count/word_count.py | ||
|
||
real 0m0.020s | ||
user 0m0.019s | ||
sys 0m0.011s | ||
|
||
=============================================================================== | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../word_count.py |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../word_count_test.py |
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.