AstuteSource / chasten

:dizzy: Chasten Uses XML and XPATH to Check a Python Program's AST for Specified Patterns!
https://pypi.org/project/chasten/
GNU General Public License v2.0
7 stars 8 forks source link

Feature: ability to pull remote configuration files over http #67

Closed simojo closed 10 months ago

simojo commented 1 year ago

closes https://github.com/AstuteSource/chasten/issues/17

This PR allows for users to specify a Url directive to a text file for the --config argument. Additionally, it tests all of the newly added features. It also moves around some functions to reduce ambiguity of the names of methods (e.g. moving things related to configuration to configuration.py)

Example usage:

chasten analyze test --config https://raw.githubusercontent.com/AstuteSource/chasten-configuration/master/config.yml --search-path .

Summary of all changes:

simojo commented 11 months ago

This is working to its fullest extent. The only remaining task is to create a test that does a sample run of chasten using a raw.githubusercontent file from the chasten-configuration directory.

simojo commented 11 months ago

I have finished the test cases that verify this PRs functionality. The only remaining step is to merge https://github.com/AstuteSource/chasten-configuration/pull/1, as it is integral to testing the pulling of remote configuration files.

simojo commented 11 months ago

Coverage appears increased (73% -> 74%)

---------- coverage: platform linux, python 3.11.4-final-0 -----------
Name                       Stmts   Miss Branch BrPart  Cover   Missing
----------------------------------------------------------------------
chasten/__init__.py            0      0      0      0   100%
chasten/__main__.py            2      2      0      0     0%   3-5
chasten/checks.py             51      6     28      5    84%   24, 86->89, 94, 99-101, 117
chasten/configuration.py     140     17     38      8    86%   157-162, 167, 203, 246-249, 346, 386-389, 407-410, 418-421, 431-433
chasten/constants.py         121      0     20      0   100%
chasten/database.py           75     62     24      0    13%   42-49, 56-76, 92-101, 115-128, 144-267, 272-289
chasten/debug.py              10      0      0      0   100%
chasten/enumerations.py       13      0      0      0   100%
chasten/filesystem.py         99     38     26      4    63%   138->145, 151->156, 162->167, 186-206, 220-236, 247-288, 294-302, 308-315
chasten/main.py              196     54     74     13    71%   76-87, 145-152, 154->exit, 163, 184->191, 347-350, 359-362, 407, 464->exit, 505->509, 510->509, 562, 570-577, 587, 628-669, 717-733, 787-804, 816-825, 832-834
chasten/output.py             93     24     30      2    71%   80-81, 87-88, 94-96, 102, 108-126, 132-134, 143-150, 204->168, 213->212
chasten/process.py            38      9     16      1    70%   27-43, 109
chasten/results.py            46      0      0      0   100%
chasten/server.py             29     18      4      0    33%   23-36, 43-67
chasten/util.py               54      7     14      2    87%   36-37, 46, 63-64, 116-117
chasten/validate.py           31      3      6      3    84%   118, 144, 162
----------------------------------------------------------------------
TOTAL                        998    240    280     38    74%
Coverage JSON written to file coverage.json
boulais01 commented 11 months ago

@simojo I went ahead and resolved merge conflicts - I tried to ensure all functionality was preserved, but it might be worth taking a quick look to make sure I didn't accidentally delete something you needed. The conflicts were in util.py and test_util.py

simojo commented 11 months ago

Thanks @boulais01. I've fixed the linting errors associated with that merge. Everything should be good now.

simojo commented 10 months ago

Hi @simojo, please consider using the PR template next time. That would be really helpful. Thanks.