Commit graph

53 commits

Author SHA1 Message Date
Luke Craig
3de8a7a8ca core: simplify generate_output_content 2025-10-27 10:16:02 -04:00
Luke Craig
2475609834 Add minimal handling for broken symlinks in generate_output_content 2025-08-11 13:35:39 -04:00
Kirill Markin
b04dd8df63
Fix pylint logging-fstring-interpolation warning
- Replace f-string with lazy % formatting in logging.debug() call
- Resolves W1203 pylint warning for better logging performance
- Achieves 10.00/10 pylint rating
2025-05-25 11:07:43 +03:00
Kirill Markin
57026bd52e
Enhance error handling in process_line and update display path in save_repo_to_text
- Add fallback logic for os.path.relpath in process_line to handle cases where it fails, ensuring robust path resolution.
- Update save_repo_to_text to use basename for displaying file paths, improving clarity in success messages and output.
- Modify tests to assert on basename instead of relative path, aligning with the new display logic.
2025-05-25 11:02:06 +03:00
Kirill Markin
3731c01a20
Refactor logging statements in core.py for improved readability
- Split long logging messages into multiple lines for better clarity
- Ensure consistent formatting across logging calls
- Minor adjustments to maintain code readability
2025-05-25 10:48:38 +03:00
Kirill Markin
7a60741471
Remove unused IO import from core.py 2025-05-25 10:48:37 +03:00
Zhan Li
e066b481af add support for splitted text by maximum word count 2025-05-25 00:11:54 -07:00
Kirill Markin
9431ff9d07
Change output format to XML
- Change output format from markdown code blocks to structured XML
- Add XML tags for better structure and parsing
- Update documentation and README
- Update version to 0.6.0
2025-04-19 13:26:18 +03:00
Ghulam Ahmed
d8977b8cf4 chore: Added package-lock.json to ignore-content in default settings 2025-03-08 22:59:52 +03:00
Kirill Markin
d124fa24cc
Refactor tree structure generation and filtering logic
- Simplified the `get_tree_structure` function by extracting the tree command execution and filtering into separate functions: `run_tree_command` and `filter_tree_output`.
- Introduced `process_line`, `extract_full_path`, and `mark_non_empty_dirs` to enhance readability and maintainability of the filtering process.
- Updated `load_ignore_specs` to improve loading of ignore specifications from settings and .gitignore files.
- Added clipboard functionality to copy output content after saving.
- Cleaned up and clarified docstrings for better understanding of function purposes.
2024-12-17 17:16:39 +01:00
Kirill Markin
ecfbed98ac
load_ignore_specs too meny local variables fix 2024-12-17 17:06:38 +01:00
Kirill Markin
2a08a70cf4
linter cleanup 2024-12-17 17:06:16 +01:00
Kirill Markin
a364328e60
remove_empty_dirs new logic and linter cleanup 2024-12-17 15:06:59 +01:00
Kirill Markin
5f283feefd
linter cleanup 2024-12-17 14:41:42 +01:00
Kirill Markin
e39e7a8896
strict-typing-and-error-handling 2024-12-16 10:24:02 +01:00
Kirill Markin
dbfa602cd3
Refactor devide logic by files and more tests 2024-12-16 01:29:31 +01:00
Kirill Markin
6a434e5174
Merge pull request #16 from himwho/main
allows wildcards and pattern ignores for specific files
2024-12-16 00:53:26 +01:00
Kirill Markin
38dac27984
fix Refactor load_ignore_specs function definition for consistency 2024-12-16 00:51:56 +01:00
Kirill Markin
4e86177cfd
Merge pull request #15 from AndrewGerstenslager/ignore-patterns
added --ignore-patterns flag to ignore content from cli
2024-12-16 00:50:22 +01:00
Kirill Markin
46941115f1
strinc typing 2024-12-16 00:29:17 +01:00
Kirill Markin
d93a1d1fb0
old utc waring fix 2024-12-16 00:29:07 +01:00
Dylan Marcus
4642e3fd09 allows wildcards and pattern ignores for specific files 2024-11-15 14:58:27 -05:00
Andrew Gerstenslager
ce996c5db7 added --ignore-patterns flag to ignore content from cli 2024-11-10 22:18:45 -05:00
Kirill Markin
fd84b62395 Merge remote-tracking branch 'remotes/caffeinum/add-aliases' into release/0.4.4 2024-11-02 20:08:42 +01:00
Kirill Markin
6b63d5309f Merge remote-tracking branch 'remotes/caffeinum/add-pipe-output' into release/0.4.4 2024-11-02 20:07:22 +01:00
Aleksey Bykhun
3e236d7508 Add aliases for repo-to-text and --create-settings
Fixes #11

Add aliases for `repo-to-text` and `--create-settings`.

* **setup.py**
  - Add alias `flatten` for `repo-to-text` in `entry_points`.

* **repo_to_text/main.py**
  - Add alias `--init` for `--create-settings` in `argparse` setup.

* **README.md**
  - Update usage documentation to include alias `flatten` for `repo-to-text`.
  - Update usage documentation to include alias `--init` for `--create-settings`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/kirill-markin/repo-to-text/issues/11?shareId=XXXX-XXXX-XXXX-XXXX).
2024-10-30 04:51:58 -07:00
Aleksey Bykhun
d3998786c0 Add pipe output feature to repo-to-text
Fixes #9

Add support for output via pipe `repo-to-text > myfile.txt`.

* Modify `save_repo_to_text` function in `repo_to_text/main.py` to write to stdout if `--stdout` is specified.
* Add `--stdout` argument to `argparse` in `repo_to_text/main.py`.
* Update `main` function in `repo_to_text/main.py` to handle the new `--stdout` argument.
* Update `README.md` to include instructions for using the new pipe output feature.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/kirill-markin/repo-to-text/issues/9?shareId=XXXX-XXXX-XXXX-XXXX).
2024-10-30 04:49:57 -07:00
Aleksey Bykhun
9847e1ff46 Accept input directory as first parameter, default to .
Related to #7

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/kirill-markin/repo-to-text/issues/7?shareId=XXXX-XXXX-XXXX-XXXX).
2024-10-30 04:40:05 -07:00
Kirill Markin
ad36a75a7a pyperclip not required 2024-10-30 08:58:24 +01:00
Dylan Marcus
1cf311bcf9 fixes ignoring subdirectories paths in the yaml 2024-10-22 01:11:15 -04:00
Kirill Markin
3513ae7165 add --create-settings option 2024-06-18 11:56:27 +02:00
Luca Gibelli
d75e2f9f72 fail softly if clipboard not available 2024-06-14 20:07:47 +02:00
Luca Gibelli
d5cc239e64 detect if tree is missing 2024-06-14 20:04:54 +02:00
Kirill Markin
5f1061a493 full_path fix 2024-06-10 08:33:30 +02:00
Kirill Markin
bdc2f2be42 filenames cleanup 2024-06-09 10:09:49 +02:00
Kirill Markin
72ac64ceb6 gitignore-import-and-ignore setting 2024-06-09 09:53:27 +02:00
Kirill Markin
b6bcdeca03 ignore-tree-and-content setting 2024-06-09 09:46:54 +02:00
Kirill Markin
7921839f08 ignore-content setting 2024-06-09 09:38:27 +02:00
Kirill Markin
afa2791a70 logging cleanup 2024-06-08 13:53:33 +02:00
Kirill Markin
6e24b727d0 cleanup 2024-06-08 13:15:23 +02:00
Kirill Markin
535a5b7fdc autor 2024-06-08 12:12:56 +02:00
Kirill Markin
a836beb856 output-dir option 2024-06-08 11:58:13 +02:00
Kirill Markin
f7b0e7df8e cleanup 2024-06-08 11:49:25 +02:00
Kirill Markin
118da435cc clipboard feature 2024-06-08 11:44:50 +02:00
Kirill Markin
a7d497f63a new result file name 2024-06-08 11:36:13 +02:00
Kirill Markin
b50abf8cd6 gitignore in tree if needed 2024-06-08 11:26:48 +02:00
Kirill Markin
efaf4654fa cleanup 2024-06-08 11:21:11 +02:00
Kirill Markin
b3282bfc6e debug logging option 2024-06-08 11:13:39 +02:00
Kirill Markin
2dd3413f0d empty dirs remove 2024-06-08 11:08:08 +02:00
Kirill Markin
d720a094dd logs 2024-06-08 10:51:22 +02:00