A Python package for RefaClass
Project description
refa-class
Single Responsibility Principle
checker
Description
This library detects classes in your source code that may violate the "Single Responsibility Principle".
Getting Started
Dependencies
- Python 3.8 or higher
Installing
-
refa-class can be installed using pip:
pip install refaclass
-
local environment
If you want to run the code locally, or change or modify it, you can install from the repo directly:git clone https://github.com/hirokazuniimoto/refa-class.git cd refa-class pip install -r requirements.txt pip install -r requirements.dev.txt
manually download the binary file ( cc.en.300.bin ) of the model and place it under the following directory. you can also change to another model if necessary. in that case, change the file name to
cc.en.300.bin
.refaclass/model/cc.en.300.bin
run in local environment
python3 -m refaclass.main The following arguments are optional: -d --dir directory path -o --output output [terminal csv]
you can use Visual Studio Code Dev Containers extension to create container
Executing program
-
you can check python
class
just like this:cd [project] refaclass The following arguments are optional: -d --dir directory path -o --output output [terminal csv]
Test
- run test
python -m unittest discover tests
- measure coverage
python -m coverage run -m unittest discover tests
python -m coverage report -m
Setting File
This project utilizes configuration files refaclass.ini
to customize its behavior and settings. Configuration files play a crucial role in tailoring the application to your specific needs.
- File Location: The configuration files are typically located in the config directory at the root of the project.
Configuration Sections
- refaclass-[class name]
- refaclass-[file name]
you can also use regular expressions
Configuration Parameters
- ignore_checks: if set to
True
, ignore file or class specified in that section - is_file: if set to
True
then the content of the section is considered a file (if set toFalse
or nois_file
parameters then class)
Example
[refaclass-test_.*.py]
is_file = True
ignore_checks = True
[refaclass-Test.*]
ignore_checks = True
Authors
Version History
- 0.1
- Initial Release
License
This project is licensed under the MIT License - see the LICENSE file for details
Reference paper
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for refaclass-1.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12d075842ebdfd57289941a1b29081f01dbfe960d31fdc8e2350de7db1d9859b |
|
MD5 | c6e00b6b118855b683d6f9c26b6b6c5a |
|
BLAKE2b-256 | ce208156d4dfb20a48772e2deb6623844d836b6ca73514f9d705a04bccb00b80 |