A new package that automates equality checks in C++ code by leveraging the upcoming reflection capabilities in C++26. This tool will allow developers to input C++ code snippets or class definitions, a
Project description
C++26 Equality Linter
A new package that automates equality checks in C++ code by leveraging the upcoming reflection capabilities in C++26. This tool allows developers to input C++ code snippets or class definitions, and the package will use llmatch-messages to parse and analyze the code, ensuring that equality operators (like ==, !=) are correctly implemented and consistent with the class's structure.
Features
- Automated equality checks for C++ code
- Leverages C++26 reflection capabilities
- Provides structured feedback on potential issues
- Suggests corrections and verifies best practices
- Easy integration with existing C++ codebases
Installation
pip install cpp26-equality-linter
Usage
Basic Usage
from cpp26-equality-linter import cpp26_equality_linter
response = cpp26_equality_linter(user_input="your C++ code here")
print(response)
Using a Custom LLM
from langchain_openai import ChatOpenAI
from cpp26-equality-linter import cpp26_equality_linter
llm = ChatOpenAI()
response = cpp26_equality_linter(user_input="your C++ code here", llm=llm)
print(response)
Using LLM7 with API Key
from cpp26-equality-linter import cpp26_equality_linter
response = cpp26_equality_linter(user_input="your C++ code here", api_key="your_api_key")
print(response)
Parameters
user_input(str): The user input text to processllm(Optional[BaseChatModel]): The langchain llm instance to use, if not provided the default ChatLLM7 will be used.api_key(Optional[str]): The api key for llm7, if not provided
Default LLM
The package uses ChatLLM7 from langchain_llm7 by default. You can safely pass your own llm instance if you want to use another LLM.
Example with OpenAI
from langchain_openai import ChatOpenAI
from cpp26-equality-linter import cpp26_equality_linter
llm = ChatOpenAI()
response = cpp26_equality_linter(user_input="your C++ code here", llm=llm)
print(response)
Example with Anthropic
from langchain_anthropic import ChatAnthropic
from cpp26-equality-linter import cpp26_equality_linter
llm = ChatAnthropic()
response = cpp26_equality_linter(user_input="your C++ code here", llm=llm)
print(response)
Example with Google
from langchain_google_genai import ChatGoogleGenerativeAI
from cpp26-equality-linter import cpp26_equality_linter
llm = ChatGoogleGenerativeAI()
response = cpp26_equality_linter(user_input="your C++ code here", llm=llm)
print(response)
Rate Limits
The default rate limits for LLM7 free tier are sufficient for most use cases of this package. If you want higher rate limits for LLM7, you can pass your own api_key via environment variable LLM7_API_KEY or via passing it directly like:
from cpp26-equality-linter import cpp26_equality_linter
response = cpp26_equality_linter(user_input="your C++ code here", api_key="your_api_key")
print(response)
You can get a free api key by registering at LLM7.
Issues
If you encounter any issues or have suggestions, please open an issue on GitHub.
Author
Eugene Evstafev
- Email: hi@eugene.plus
- GitHub: chigwell
- LinkedIn: Eugene Evstafev
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cpp26_equality_linter-2025.12.20185334.tar.gz.
File metadata
- Download URL: cpp26_equality_linter-2025.12.20185334.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8f54d9f06302bfed1afccb88b67896dbb6903e34204523827d10e7a4de28895
|
|
| MD5 |
023c5990c80734d9c1fe0d147ea14a1b
|
|
| BLAKE2b-256 |
5f912804e5acf9cc4da9c8d5e174d117af7ca7eca7abf2cb7b5569855962cb2e
|
File details
Details for the file cpp26_equality_linter-2025.12.20185334-py3-none-any.whl.
File metadata
- Download URL: cpp26_equality_linter-2025.12.20185334-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
017e354f63298ccfac8a89bebfd34c65b27695b640933f92eba517db76a02645
|
|
| MD5 |
1975f43fe13fcf56ab56eeeedc3814bc
|
|
| BLAKE2b-256 |
9dd5183dfa15a0b620a3bb5abbb012a926aba35c3129db79f17fd6335be0af4d
|