Skip to content

Commit 412d489

Browse files
committed
[add:docs] Init documentation for "Read The Docs"
1 parent bf4b3b7 commit 412d489

25 files changed

+1601
-0
lines changed

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/how_it_works/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sdfsdf

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/source/api_reference/cli.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. _api_cli:
2+
3+
Command-Line Interface
4+
======================
5+
6+
.. automodule:: code_validator.cli
7+
:members:
8+
:undoc-members:
9+
:show-inheritance:
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.. _api_components:
2+
3+
Component Architecture
4+
======================
5+
6+
This section documents the core architectural components, such as protocols
7+
and factories.
8+
9+
.. rubric:: Component Interfaces
10+
11+
.. automodule:: code_validator.components.definitions
12+
:members:
13+
14+
.. rubric:: Component Factories
15+
16+
.. automodule:: code_validator.components.factories
17+
:members:
18+
19+
.. rubric:: Helper Modules
20+
21+
.. automodule:: code_validator.components.scope_handler
22+
:members:
23+
.. automodule:: code_validator.components.ast_utils
24+
:members:

docs/source/api_reference/config.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. _api_config:
2+
3+
Configuration Models
4+
====================
5+
6+
.. automodule:: code_validator.config
7+
:members:
8+
:undoc-members:
9+
:show-inheritance:

docs/source/api_reference/core.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. _api_core:
2+
3+
Core Validator Engine
4+
=====================
5+
6+
.. automodule:: code_validator.core
7+
:members:
8+
:undoc-members:
9+
:show-inheritance:
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. _api_exceptions:
2+
3+
Custom Exceptions
4+
=================
5+
6+
.. automodule:: code_validator.exceptions
7+
:members:
8+
:undoc-members:
9+
:show-inheritance:

docs/source/api_reference/index.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.. _api_reference:
2+
3+
*************
4+
API Reference
5+
*************
6+
7+
This section provides auto-generated documentation from the source code's
8+
docstrings. It details the classes, methods, and functions available for
9+
programmatic use or for extending the validator.
10+
11+
This reference is intended for developers who wish to understand the internal
12+
workings of the ``code-validator`` package or contribute to its development.
13+
14+
15+
.. toctree::
16+
:maxdepth: 1
17+
:caption: Core Modules:
18+
19+
cli
20+
core
21+
config
22+
output
23+
exceptions
24+
25+
.. toctree::
26+
:maxdepth: 1
27+
:caption: Component Architecture:
28+
29+
components
30+
rules_library

docs/source/api_reference/output.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. _api_output:
2+
3+
Console & Logging
4+
=================
5+
6+
.. automodule:: code_validator.output
7+
:members:
8+
:undoc-members:
9+
:show-inheritance:
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.. _api_rules_library:
2+
3+
Rule & Component Library
4+
========================
5+
6+
This section documents the concrete implementations of all rules, selectors,
7+
and constraints.
8+
9+
.. rubric:: Rule Handlers
10+
11+
.. automodule:: code_validator.rules_library.basic_rules
12+
:members:
13+
14+
.. rubric:: Selectors
15+
16+
.. automodule:: code_validator.rules_library.selector_nodes
17+
:members:
18+
19+
.. rubric:: Constraints
20+
21+
.. automodule:: code_validator.rules_library.constraint_logic
22+
:members:

docs/source/changelog.rst

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
*********
2+
Changelog
3+
*********
4+
5+
All notable changes to this project will be documented in this file.
6+
7+
The format is based on `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`_,
8+
and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.
9+
10+
.. _unreleased:
11+
12+
Unreleased
13+
==========
14+
15+
*This section is for upcoming changes. It will become the next version's release notes.*
16+
17+
**Added**
18+
- *... (e.g., Added `must_have_docstring` constraint)*
19+
20+
**Changed**
21+
- *...*
22+
23+
**Fixed**
24+
- *...*
25+
26+
27+
v0.1.1 - 2025-06-17
28+
===================
29+
30+
The documentation for ReadTheDocs has been written and the book How It Works has also been completed. Deepwiki is integrated into the repository
31+
32+
**Added:**
33+
34+
- **Documentation**: A resource for Reading The Docs in `docs/source`.
35+
- **How It Works**: How It Works in `docs/how_it_works/index.md`.
36+
- **AI in repository**: Deep wiki by `https://deepwiki.com/Qu1nel/PythonCodeValidator`
37+
38+
.. _v0.1.0:
39+
40+
v0.1.0 - 2025-06-16
41+
===================
42+
43+
This is the initial public release of the Python Code Validator framework.
44+
45+
**Added:**
46+
47+
- **Core Engine**: Implemented the main `StaticValidator` for orchestrating the validation process.
48+
- **JSON Format**: Designed and implemented the first version of the JSON format for validation rules.
49+
- **Short Rules**: Added support for `check_syntax` and `check_linter_pep8`.
50+
- **Selectors**: Implemented a full suite of selectors (`function_def`, `class_def`, `import_statement`, `assignment`, `usage`, `literal`, `ast_node`).
51+
- **Constraints**: Implemented a full suite of constraints (`is_required`, `is_forbidden`, `must_inherit_from`, `must_be_type`, etc.).
52+
- **Scoping**: Added support for `in_scope` to apply rules to specific functions, classes, and methods.
53+
- **CLI**: Created the `validate-code` command-line interface.
54+
- **Testing**: Established a comprehensive test suite with over 90% code coverage.
55+
- **CI/CD**: Set up a GitHub Actions workflow for automated testing and linting.

docs/source/conf.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import os
2+
import sys
3+
4+
# Configuration file for the Sphinx documentation builder.
5+
#
6+
# For the full list of built-in configuration values, see the documentation:
7+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
8+
9+
# -- Project information -----------------------------------------------------
10+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
11+
12+
# -- Project information -----------------------------------------------------
13+
project = 'Python Code Validator'
14+
# noinspection PyShadowingBuiltins
15+
copyright = '2025, Ivan Kovach (@Qu1nel)'
16+
author = 'Ivan Kovach (@Qu1nel)'
17+
release = '0.1.1'
18+
19+
# -- General configuration ---------------------------------------------------
20+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
21+
22+
# -- General configuration ---------------------------------------------------
23+
extensions = [
24+
'sphinx.ext.autodoc',
25+
'sphinx.ext.napoleon',
26+
'myst_parser',
27+
'sphinx_design',
28+
]
29+
30+
templates_path = ['_templates']
31+
exclude_patterns = []
32+
33+
# -- Options for HTML output -------------------------------------------------
34+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
35+
36+
html_theme = 'furo'
37+
html_static_path = ['_static']
38+
39+
# -- Path setup --------------------------------------------------------------
40+
41+
42+
# noinspection PyTypeChecker
43+
sys.path.insert(0, os.path.abspath('../../src'))

0 commit comments

Comments
 (0)