Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync fork #2

Merged
merged 108 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
b7d51e6
Improve comment stripper module
raphaelmansuy Jun 28, 2024
525889b
Feat: Implement include and exclude patterns for file filtering
raphaelmansuy Jun 28, 2024
2a01c7f
restructure the code
raphaelmansuy Jun 28, 2024
08110da
fix
raphaelmansuy Jun 28, 2024
65f2d13
Add line numbers to source code files
raphaelmansuy Jun 28, 2024
f1ed9f0
restructure the code
raphaelmansuy Jun 28, 2024
4e4b2db
no code block
raphaelmansuy Jun 28, 2024
825ecfd
restructure code
raphaelmansuy Jun 28, 2024
b4aec89
clean
raphaelmansuy Jun 28, 2024
57c123d
implement template
raphaelmansuy Jun 28, 2024
7b5faee
add template
raphaelmansuy Jun 28, 2024
92faedf
refactor
raphaelmansuy Jun 28, 2024
e60b123
update documentation
raphaelmansuy Jun 28, 2024
58e0ca2
Update README.md
raphaelmansuy Jun 28, 2024
18b9d8d
Update README.md
raphaelmansuy Jun 28, 2024
a3dbdb8
update doc
raphaelmansuy Jun 28, 2024
1cf0bbd
add version
raphaelmansuy Jun 28, 2024
d033c00
update doc
raphaelmansuy Jun 28, 2024
d40fc5d
update
raphaelmansuy Jun 28, 2024
2877874
update
raphaelmansuy Jun 28, 2024
728115b
update
raphaelmansuy Jun 28, 2024
e499205
refactor
raphaelmansuy Jun 28, 2024
6871e48
- Modify the `process_files` function to handle processing of a singl…
raphaelmansuy Jun 28, 2024
919a6fc
add create template directory
raphaelmansuy Jun 28, 2024
2028400
fix multiple files
raphaelmansuy Jun 28, 2024
490daa6
v 0.6.0
raphaelmansuy Jun 28, 2024
b581bfe
add copy to clipboard
raphaelmansuy Jun 28, 2024
5a94a5c
fix version
raphaelmansuy Jun 28, 2024
ce28263
v 0.6.2
raphaelmansuy Jun 28, 2024
7250a8a
restructure project v 0.6.3
raphaelmansuy Jun 29, 2024
f5b3033
Refactor codebase to improve readability and maintainability
raphaelmansuy Jun 29, 2024
9cfb2bb
fix documentation
raphaelmansuy Jun 29, 2024
0f2bbcc
improve display
raphaelmansuy Jun 29, 2024
06de99d
improve display
raphaelmansuy Jun 29, 2024
44abc8f
Update TEMPLATE.md
raphaelmansuy Jun 29, 2024
2dc1491
Update TEMPLATE.md
raphaelmansuy Jun 29, 2024
fcc2294
Update TEMPLATE.md
raphaelmansuy Jun 29, 2024
676c382
first version of config
raphaelmansuy Jun 29, 2024
b64d087
v 0.6.5 improve config file
raphaelmansuy Jun 29, 2024
6dad29f
Update README.md
raphaelmansuy Jun 29, 2024
a2499fc
improve documentation
raphaelmansuy Jun 29, 2024
ddabe1a
update
raphaelmansuy Jun 29, 2024
a6c0606
update
raphaelmansuy Jun 29, 2024
e3262f4
Create create-readme.j2
raphaelmansuy Jun 29, 2024
10a01ce
Update create_readme.j2
raphaelmansuy Jun 29, 2024
c5671ee
update
raphaelmansuy Jul 2, 2024
1bfc954
improve test structure
raphaelmansuy Jul 2, 2024
b2d49ef
update .gitignore
raphaelmansuy Jul 2, 2024
ceb3f53
update
raphaelmansuy Jul 3, 2024
8ab745f
update
raphaelmansuy Jul 3, 2024
d48f3f5
update
raphaelmansuy Jul 3, 2024
69e1cb9
fix
raphaelmansuy Jul 3, 2024
43ca2ce
Improve doc
raphaelmansuy Jul 3, 2024
56c885d
imrprove template readme.md
raphaelmansuy Jul 3, 2024
161b238
v 0.6.6
raphaelmansuy Jul 3, 2024
bce6da8
update
raphaelmansuy Jul 3, 2024
6f75791
update
raphaelmansuy Jul 3, 2024
e58441e
update README.md
raphaelmansuy Jul 3, 2024
9142be6
v 0.6.7
raphaelmansuy Jul 3, 2024
90d1182
update README.md
raphaelmansuy Jul 3, 2024
33fe4a1
fix(.): update: improve --create-templates functionality
raphaelmansuy Jul 5, 2024
0c03833
fix(.): r(.gitignore): ignore cli.log file
raphaelmansuy Jul 5, 2024
1cd35fe
fix(.): doc/update-readme: enhance readme with details on code2prompt…
raphaelmansuy Jul 5, 2024
d863d13
fix(.): master(core): improve display --tokens feature
raphaelmansuy Jul 5, 2024
79513f2
Update create-readme.j2
raphaelmansuy Jul 5, 2024
6e7e117
Bump certifi from 2024.6.2 to 2024.7.4 (#8)
dependabot[bot] Jul 5, 2024
47f6a69
fix(.): master(docs): add screenshot to README
raphaelmansuy Jul 6, 2024
f336ef7
fix(.): Add Code of Conduct and Contributing guidelines
raphaelmansuy Jul 6, 2024
9e48e3c
Create SECURITY.md
raphaelmansuy Jul 6, 2024
cd07a64
Update issue templates
raphaelmansuy Jul 6, 2024
21e09db
Update README.md
raphaelmansuy Jul 6, 2024
dddf9eb
Update README.md
raphaelmansuy Jul 6, 2024
d7dac91
Update README.md
raphaelmansuy Jul 8, 2024
0d108fa
Update README.md
raphaelmansuy Jul 8, 2024
5dee241
Update README.md
raphaelmansuy Jul 8, 2024
e663f35
Update README.md
raphaelmansuy Jul 8, 2024
856a490
Update README.md
raphaelmansuy Jul 8, 2024
f19a5e3
Update README.md
raphaelmansuy Jul 8, 2024
5b83fb8
Update README.md
raphaelmansuy Jul 8, 2024
bbaa31b
Update README.md
raphaelmansuy Jul 8, 2024
d8d382f
fix(.): master(remove hello1.txt file, update README, add price estim…
raphaelmansuy Jul 11, 2024
09783e6
fix(.temp): master(code2prompt): Remove unused .temp files
raphaelmansuy Jul 11, 2024
37f4e42
Update README.md
raphaelmansuy Jul 11, 2024
0ad5049
fix(code2prompt/data): add description to token_price.json and update…
raphaelmansuy Jul 26, 2024
44875b6
fix(code2prompt/core): Improve variable extraction and user input han…
raphaelmansuy Jul 26, 2024
4ae41f1
fix(code2prompt/utils): Optimize `calculate_prices` function and add …
raphaelmansuy Jul 26, 2024
ec92cbf
fix(.): update(features): add support for dynamic variables in templates
raphaelmansuy Jul 26, 2024
279d125
fix(code2prompt/core): Add support for template include feature
raphaelmansuy Jul 26, 2024
db8b31f
fix(.): Add include file feature
raphaelmansuy Jul 26, 2024
a4a80ac
fix(.): (include-file): add support for including external files in t…
raphaelmansuy Jul 26, 2024
dbdca94
Update README.md
raphaelmansuy Jul 26, 2024
207e0cf
fix(code2prompt/core): handle circular include errors in template pro…
raphaelmansuy Jul 26, 2024
390de35
fix
raphaelmansuy Jul 26, 2024
317adcf
fix(code2prompt/core): Handle missing template file in template proce…
raphaelmansuy Jul 26, 2024
ba11fa5
fix(input, include): fix bugs in input variables and include
raphaelmansuy Jul 26, 2024
fb930ab
feat(.): added codebase analysis feature
raphaelmansuy Jul 26, 2024
ae679ee
Update improve-this-prompt.j2
raphaelmansuy Jul 26, 2024
a6a19bc
Update create-function.j2
raphaelmansuy Jul 26, 2024
7a5343d
Update create-function.j2
raphaelmansuy Jul 26, 2024
c8647d4
Fix/interractive_4 (#16)
raphaelmansuy Sep 7, 2024
6c9a7e9
master(version): Bump version to 0.8.0
raphaelmansuy Sep 7, 2024
57383dd
master(feature): Add interactive mode for file selection
raphaelmansuy Sep 7, 2024
21ef6ef
Fix/file-selection (#17)
raphaelmansuy Sep 8, 2024
8f48f97
feat(syntax-highlighting): add custom syntax mapping support (#18)
raphaelmansuy Sep 8, 2024
3581b41
fix(code2prompt/utils): update is_filtered function to handle exclude…
raphaelmansuy Sep 8, 2024
b015091
improve markdown
raphaelmansuy Mar 24, 2024
f9ea63f
Add contrib
CTY-git Sep 23, 2024
54c54c6
fixes
CTY-git Sep 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .code2promptrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"suppress_comments": false,
"line_number": false,
"log_level": "INFO",
"encoding": "cl100k_base",
"filter": "*.py,*.js",
"exclude": "tests/*,docs/*"
}
31 changes: 31 additions & 0 deletions .cursorrules
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

# Role Overview

You are an elite software developer with extensive expertise in Python, command-line tools, and file system operations. Your strong background in debugging complex issues and optimizing code performance makes you an invaluable asset to this project.

## Key Attributes

- **Pragmatic Approach**: You prioritize delivering high-quality, maintainable code that meets project requirements.
- **Modular Design**: You embrace composability and modularity, ensuring that your code is easy to extend and maintain.
- **Principled Coding**: You adhere to the KISS (Keep It Simple, Stupid) and DRY (Don't Repeat Yourself) principles, promoting simplicity and efficiency.
- **Documentation & Testing**: You recognize the importance of clear documentation and thorough testing to guarantee the reliability of your work.
- **Functional Preference**: You prefer using functions and modules over classes, focusing on functional programming paradigms.

## Technological Stack

This project utilizes the following technologies:

- **Python Version**: 3.6+
- **Dependencies**:
- `python = "^3.8,<4.0"`
- `rich = "^13.7.1"` # For rich text and beautiful formatting
- `click = "^8.1.7"` # For creating elegant command-line interfaces
- `jinja2 = "^3.1.4"` # For template rendering
- `prompt-toolkit = "^3.0.47"` # For building powerful interactive command-line applications
- `tiktoken = "^0.7.0"` # For tokenization tasks
- `pyperclip = "^1.9.0"` # For clipboard operations
- `colorama = "^0.4.6"` # For colored terminal text output
- `tqdm = "^4.66.4"` # For progress bars
- `tabulate = "^0.9.0"` # For tabular data formatting
- `pydantic` # For data validation and type checking
- `poetry` # For dependency management
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ dist
__pycache__
.pytest_cache
*.pyc
.DS_Store
.DS_Store
.tasks
cli.log
.aider*
.ruff_cache
71 changes: 71 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
## [Unreleased]

### Added

- New features and improvements planned for the next release.

### Changed

- Updates and enhancements under consideration for future versions.

### Deprecated

- Features that will be removed in future releases.

### Removed

- Features that have been removed in this version.

### Fixed

- Bug fixes that are currently being addressed.

## [Released]

### [0.8.1] - 2024-09-08

- **Fixed**: Fix the selection on individual files. You must install it.

### [0.8.0] - 2024-09-07

- **Added**: `--interactive` mode for enhanced user interaction.

### [0.6.12] - 2024-08-01

- **Fixed**: Bugs related to input variables and inclusion functionality.

### [0.6.11] - 2024-07-15

- **Added**: Support for dynamic variables such as `{{input:var1}}` in templates.
- **Added**: Support for `{% include "./file1.txt" %}` feature.
- **Fixed**: Ensured variables are only processed once.
- **Updated**: Improved the price table for better clarity.

### [0.6.9] - 2024-06-10

- **Improved**: Display of tokens for better user experience.

### [0.6.8] - 2024-05-20

- **Improved**: `--create-templates-flags` functionality.
- **Enhanced**: Overall quality of templates.

### [0.6.6] - 2024-04-15

- **Added**: New templates to expand functionality.
- **Fixed**: Bugs related to `--exclude` and `include` features.

## Guidelines for Maintaining the Changelog

- **Keep It Human-Friendly**: Ensure that the changelog is written for users, not just for developers. Avoid technical jargon where possible.

- **Chronological Order**: List changes in reverse chronological order, with the most recent changes at the top.

- **Linkable Versions**: Ensure that each version entry is linkable for easy reference.

- **Clear Sections**: Use distinct sections for added, changed, deprecated, removed, and fixed items to enhance readability.

- **Release Dates**: Include the release date for each version to provide context for users.

- **Unreleased Section**: Maintain an "Unreleased" section at the top for tracking upcoming changes, which helps users anticipate future updates.

113 changes: 30 additions & 83 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,128 +1,75 @@
# Contributor Covenant Code of Conduct
# Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:
Examples of behavior that contributes to a positive environment for our community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
- The use of sexualized language or imagery, and sexual attention or advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others’ private information, such as a physical or email address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned with this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
raphael.mansuy@gmail.com.
All complaints will be reviewed and investigated promptly and fairly.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at contact@elitizon.com. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
All community leaders are obligated to respect the privacy and security of the reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.
**Community Impact**: A violation through a single incident or series of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.
**Consequence**: A permanent ban from any sort of public interaction within the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.0, available at [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are available at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations).
Loading