repo
stringlengths
5
53
pr_number
int32
1
321k
task_type
stringclasses
2 values
issue_text
stringlengths
0
81.2k
pr_title
stringlengths
1
319
pr_body
stringlengths
0
105k
base_sha
stringlengths
40
40
head_sha
stringlengths
40
40
gold_diff
stringlengths
0
202M
changed_files
listlengths
0
100
review_threads
listlengths
0
100
test_patch
stringlengths
0
23.4M
merged
bool
1 class
Textualize/rich
4,080
issue_to_patch
bump to 15.0.0
Bump to 15.0.0
ffe2edc5968eac19d5493c2d7b27965031a692e9
82e06e0d9985fd8cce456dc3977e0d2d9e84b4d8
diff --git a/CHANGELOG.md b/CHANGELOG.md index bdcfb49ad2..dabe7094cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,11 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -# Unreleased...
[ "CHANGELOG.md", "pyproject.toml" ]
[ { "comment": "```suggestion\n- Breaking change: Dropped support for Python3.8 https://github.com/Textualize/rich/pull/4075\n```", "path": "CHANGELOG.md", "hunk": "@@ -6,11 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),\n and this project adheres to [Semantic Ve...
true
Textualize/rich
4,080
comment_to_fix
bump to 15.0.0
```suggestion - Breaking change: Dropped support for Python3.8 https://github.com/Textualize/rich/pull/4075 ```
ffe2edc5968eac19d5493c2d7b27965031a692e9
82e06e0d9985fd8cce456dc3977e0d2d9e84b4d8
diff --git a/CHANGELOG.md b/CHANGELOG.md index bdcfb49ad2..dabe7094cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,11 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -# Unreleased...
[ "CHANGELOG.md" ]
[ { "comment": "```suggestion\n- Breaking change: Dropped support for Python3.8 https://github.com/Textualize/rich/pull/4075\n```", "path": "CHANGELOG.md", "hunk": "@@ -6,11 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),\n and this project adheres to [Semantic Ve...
true
Textualize/rich
4,079
issue_to_patch
[BUG] `TableDataElement.on_text` clobbers syntax-highlight spans for inline code - [x] I've checked [docs](https://rich.readthedocs.io/en/latest/introduction.html) and [closed issues](https://github.com/Textualize/rich/issues?q=is%3Aissue+is%3Aclosed) for possible solutions. - [x] I can't find my issue in the [FAQ](ht...
Inline table code
Fixes https://github.com/Textualize/rich/issues/4038
19c67b9a3479841e9133bea94607c89ee931d3fc
cf3b5a16f7a76b2e8c4921d3314021bb72a6c5c1
diff --git a/CHANGELOG.md b/CHANGELOG.md index d2e7906004..bdcfb49ad2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed empty print ignoring the `end` parameter - Fixed `Text.from_ansi` removing newlines https://gith...
[ "CHANGELOG.md", "rich/markdown.py", "tests/test_markdown.py" ]
[]
diff --git a/tests/test_markdown.py b/tests/test_markdown.py index a76eac9b18..c461c76966 100644 --- a/tests/test_markdown.py +++ b/tests/test_markdown.py @@ -199,6 +199,22 @@ def test_table_with_empty_cells() -> None: assert result == expected +def test_inline_code_in_table_cells() -> None: + """Test inlin...
true
Textualize/rich
4,076
issue_to_patch
[BUG] Trailing line break removed by Text.from_ansi(). - [x] I've checked [docs](https://rich.readthedocs.io/en/latest/introduction.html) and [closed issues](https://github.com/Textualize/rich/issues?q=is%3Aissue+is%3Aclosed) for possible solutions. - [x] I can't find my issue in the [FAQ](https://github.com/Textualiz...
preserve newlines
Fixes https://github.com/Textualize/rich/issues/3577
9cb198944f8184df92217efc8b20d3fffa4b4fa0
48293cde887c4f25a7bca022131b56495f370a88
diff --git a/CHANGELOG.md b/CHANGELOG.md index ab758b1cec..f4c27de5f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed empty print ignoring the `end` parameter +- Fixed `Text.from_ansi` removing newlines...
[ "CHANGELOG.md", "docs/source/console.rst", "rich/ansi.py", "tests/test_ansi.py" ]
[]
diff --git a/tests/test_ansi.py b/tests/test_ansi.py index d81f6459f6..21e20b4403 100644 --- a/tests/test_ansi.py +++ b/tests/test_ansi.py @@ -20,13 +20,14 @@ def test_decode(): decoder = AnsiDecoder() lines = list(decoder.decode(terminal_codes)) - + print(repr(lines)) expected = [ Text("He...
true
Textualize/rich
4,075
issue_to_patch
[BUG] test_assemble_meta fails with Python 3.14.0b1 - [x] I've checked [docs](https://rich.readthedocs.io/en/latest/introduction.html) and [closed issues](https://github.com/Textualize/rich/issues?q=is%3Aissue+is%3Aclosed) for possible solutions. - [x] I can't find my issue in the [FAQ](https://github.com/Textualize/r...
empty with end
- Fixes https://github.com/Textualize/rich/issues/3740 - Drop support for Python 3.8
1fc7cb210ae52eb099df39818ddb9569e5b14c7b
eccb5945ddb8487d655d2ab54f3443d072ef4247
diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index ab8745fd6d..87eee0895d 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -9,7 +9,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest, macos-l...
[ ".github/workflows/pythonpackage.yml", "CHANGELOG.md", "pyproject.toml", "rich/console.py", "tests/test_console.py" ]
[]
diff --git a/tests/test_console.py b/tests/test_console.py index ef82987394..e52c1b3633 100644 --- a/tests/test_console.py +++ b/tests/test_console.py @@ -192,6 +192,12 @@ def test_print() -> None: assert console.file.getvalue() == "foo\n" +def test_print_empty_with_end() -> None: + console = Console(file=i...
true
Textualize/rich
3,941
issue_to_patch
[BUG]Typing of console.save_html is overly strict. - [x] I've checked [docs](https://rich.readthedocs.io/en/latest/introduction.html) and [closed issues](https://github.com/Textualize/rich/issues?q=is%3Aissue+is%3Aclosed) for possible solutions. - [x] I can't find my issue in the [FAQ](https://github.com/Textualize/ri...
Fix typing for save_html, save_text, save_svg to accept PathLike
<!-- Please note that Rich isn't accepting any new features at this point. If a feature can be implemented without modifying the core library, then they should be released as a third-party module. I can accept updates to the core library that make it easier to extend (think hooks). Bugfixes are always welcome ...
c595fa95068dd2c5095d25446b2f0571bc0b3995
31ce129a915bab47fa7ddc8e15af77480666fefe
diff --git a/rich/console.py b/rich/console.py index ad92d529c0..ce476dd95f 100644 --- a/rich/console.py +++ b/rich/console.py @@ -34,6 +34,7 @@ cast, runtime_checkable, ) +from os import PathLike from rich._null_file import NULL_FILE @@ -2206,11 +2207,11 @@ def export_text(self, *, clear: bool = True, ...
[ "rich/console.py" ]
[]
true
Textualize/rich
4,073
issue_to_patch
bump
bump to 14.3.4
a86dce09714f4e5195cce8c15fce7a586d7b562a
f441a326f10af5dc0cd570dadaed16e7f7035fc3
diff --git a/CHANGELOG.md b/CHANGELOG.md index 68e439e28c..20ec85bd5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semant...
[ "CHANGELOG.md", "pyproject.toml" ]
[]
true
Textualize/rich
3,678
issue_to_patch
Don't underline indentation
Prevent code highlights in exceptions from highlighting indentation. Previously indentation was underline, which didn't look good. <img width="1400" alt="Screenshot 2025-03-29 at 15 55 15" src="https://github.com/user-attachments/assets/67147fa5-25f4-4d34-a08d-97cea8996e32" /> <img width="1400" alt="Screenshot 2025-0...
d43db994181f91cfa996f2f3df3b557ba87494e4
47da97e46a529905a170d609c38bd1380034583a
diff --git a/rich/default_styles.py b/rich/default_styles.py index 3975a3615f..42020615f2 100644 --- a/rich/default_styles.py +++ b/rich/default_styles.py @@ -120,7 +120,7 @@ "traceback.exc_type": Style(color="bright_red", bold=True), "traceback.exc_value": Style.null(), "traceback.offset": Style(color="...
[ "rich/default_styles.py", "rich/traceback.py" ]
[]
true
Textualize/rich
3,514
issue_to_patch
Drop Python 3.7 leftovers
## Type of changes - [X] Documentation / docstrings - [X] Tests - [X] Other ## Description Some Python 3.7 leftovers remained when support for Python 3.7 was dropped in https://github.com/Textualize/rich/releases/tag/v13.9.0. This completes the drop. Eg. PyPI still shows support for `3.7`. <img width="...
36f3ca645dd225ef5d9d836e1e3c480dc3f68ff0
0a549ce1af280e2e08fdc5552169f3b4fe638a33
diff --git a/.readthedocs.yml b/.readthedocs.yml index 05c863a93d..eec1cb22a3 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -12,7 +12,7 @@ sphinx: formats: all python: - version: 3.7 + version: 3.8 install: - requirements: docs/requirements.txt - method: pip diff --git a/README.md b/README....
[ ".readthedocs.yml", "README.md", "pyproject.toml", "tests/test_inspect.py", "tests/test_pretty.py", "tests/test_repr.py", "tox.ini" ]
[]
diff --git a/tests/test_inspect.py b/tests/test_inspect.py index 4f2494433c..130e8df129 100644 --- a/tests/test_inspect.py +++ b/tests/test_inspect.py @@ -13,11 +13,6 @@ ) from rich.console import Console -skip_py37 = pytest.mark.skipif( - sys.version_info.minor == 7 and sys.version_info.major == 3, - reason=...
true
Textualize/rich
3,192
issue_to_patch
[BUG] `Panel.fit` forgot `height` and `highlight` parameters - [x] I've checked [docs](https://rich.readthedocs.io/en/latest/introduction.html) and [closed issues](https://github.com/Textualize/rich/issues?q=is%3Aissue+is%3Aclosed) for possible solutions. - [x] I can't find my issue in the [FAQ](https://github.com/Te...
Add missing Panel.fit parameters
This was such a quick fix that while triaging I thought I may as well just fix it. Fixes #3142.
21c0f25869bcdd0ef4e8ebc8d48c4b362147f740
a31eefde90670fd9c35197e53043157581beb4ea
diff --git a/CHANGELOG.md b/CHANGELOG.md index 1113f8617e..f68d33c025 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semanti...
[ "CHANGELOG.md", "rich/panel.py" ]
[]
true
Textualize/rich
3,486
issue_to_patch
report fine grained error locations
Adds PEP 657 finely grained error locations to rich.traceback
d0de442c08df8793c5ff36d9ad322ca5c47fc38c
a92b399d5c9749010cc3a7035fde3da250a5876c
diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 18b923cfe2..c46f002ae6 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -10,10 +10,8 @@ jobs: matrix: os: [windows-latest, ubuntu-latest, macos-latest] pytho...
[ ".github/workflows/pythonpackage.yml", "CHANGELOG.md", "poetry.lock", "pyproject.toml", "rich/default_styles.py", "rich/syntax.py", "rich/traceback.py", "tests/test_traceback.py" ]
[]
diff --git a/tests/test_traceback.py b/tests/test_traceback.py index 7f1525c284..ed80d1ba71 100644 --- a/tests/test_traceback.py +++ b/tests/test_traceback.py @@ -327,3 +327,34 @@ def level3(): assert len(frames) == expected_frames_length frame_names = [f.name for f in frames] assert frame_na...
true
Textualize/rich
3,698
issue_to_patch
[BUG] Readthedocs search does not work anymore - [x] I've checked [docs](https://rich.readthedocs.io/en/latest/introduction.html) and [closed issues](https://github.com/Textualize/rich/issues?q=is%3Aissue+is%3Aclosed) for possible solutions. - [x] I can't find my issue in the [FAQ](https://github.com/Textualize/rich/b...
docs: fix search not working
Fix the documentation search not working after a recent Read the Docs upgrade. This adds `sphinx_rtd_theme` to the extensions as recommended in the install guide: https://sphinx-rtd-theme.readthedocs.io/en/stable/installing.html Fixes: #3697 ## Type of changes - [ ] Bug fix - [ ] New feature - [x] Documen...
0c6c75644f80530de219dae3e94f0aeb999f9b4c
a648cdcec2ded5dd57b1a498102c983c71354f9a
diff --git a/docs/source/conf.py b/docs/source/conf.py index 451a134561..6f82deda28 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -50,6 +50,7 @@ "sphinx.ext.intersphinx", "sphinx.ext.autosectionlabel", "sphinx_copybutton", + "sphinx_rtd_theme", ] # Add any paths that contain templa...
[ "docs/source/conf.py" ]
[]
true
Textualize/rich
2,031
issue_to_patch
[REQUEST] Add explicit support for NamedTuples The Pretty class doesn't support pretty printing NamedTuples. We should attempt to auto detect named tuples in order to expand these on to multiple lines as appropriate. NamedTuples inherit from `tuple` and don't have a common base class. They have a `_fields` attri...
Add support for named tuples to pretty
## Type of changes - [ ] Bug fix - [x] New feature - [ ] Documentation / docstrings - [ ] Tests - [ ] Other ## Checklist - [x] I've run the latest [black](https://github.com/psf/black) with default args on new code. - [x] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate. - [x] I've added t...
8e649fea51859e426b2f6300e0a9c88c9c4b6415
5d64431242cfb9529ca36302c91302dd9f22b9b4
diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a0e3e5182..588be1e45a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ + # Changelog All notable changes to this project will be documented in this file. @@ -14,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ...
[ "CHANGELOG.md", "rich/pretty.py", "tests/test_pretty.py" ]
[ { "comment": "We are also going to need a check to see if the default `__repr__` was overriden. If it was, Rich should respect that. Have a look at `_is_dataclass_repr`, maybe we can do something similar for NamedTuple.", "path": "rich/pretty.py", "hunk": "@@ -731,7 +753,23 @@ def iter_attrs() -> Iterab...
diff --git a/tests/test_pretty.py b/tests/test_pretty.py index 02488f4645..d45b0c22db 100644 --- a/tests/test_pretty.py +++ b/tests/test_pretty.py @@ -1,9 +1,10 @@ +import collections import io import sys from array import array from collections import UserDict, defaultdict from dataclasses import dataclass, field...
true
Textualize/rich
2,031
comment_to_fix
Add support for named tuples to pretty
We are also going to need a check to see if the default `__repr__` was overriden. If it was, Rich should respect that. Have a look at `_is_dataclass_repr`, maybe we can do something similar for NamedTuple.
8e649fea51859e426b2f6300e0a9c88c9c4b6415
5d64431242cfb9529ca36302c91302dd9f22b9b4
diff --git a/rich/pretty.py b/rich/pretty.py index 216075afdc..57f3e62e2c 100644 --- a/rich/pretty.py +++ b/rich/pretty.py @@ -1,4 +1,5 @@ import builtins +import collections import dataclasses import inspect import os @@ -30,7 +31,6 @@ except ImportError: # pragma: no cover _attr_module = None # type: igno...
[ "rich/pretty.py" ]
[ { "comment": "We are also going to need a check to see if the default `__repr__` was overriden. If it was, Rich should respect that. Have a look at `_is_dataclass_repr`, maybe we can do something similar for NamedTuple.", "path": "rich/pretty.py", "hunk": "@@ -731,7 +753,23 @@ def iter_attrs() -> Iterab...
true
Textualize/rich
2,031
comment_to_fix
Add support for named tuples to pretty
I wonder if we can be more precise than this. I know there is no `is_namedtuple` function, alas.
8e649fea51859e426b2f6300e0a9c88c9c4b6415
5d64431242cfb9529ca36302c91302dd9f22b9b4
diff --git a/rich/pretty.py b/rich/pretty.py index 216075afdc..57f3e62e2c 100644 --- a/rich/pretty.py +++ b/rich/pretty.py @@ -1,4 +1,5 @@ import builtins +import collections import dataclasses import inspect import os @@ -30,7 +31,6 @@ except ImportError: # pragma: no cover _attr_module = None # type: igno...
[ "rich/pretty.py" ]
[ { "comment": "I wonder if we can be more precise than this. I know there is no `is_namedtuple` function, alas.", "path": "rich/pretty.py", "hunk": "@@ -524,6 +524,28 @@ def __str__(self) -> str:\n )\n \n \n+def _is_namedtuple(obj: Any) -> bool:", "resolving_sha": "5d64431242cfb9529ca3630...
true
Textualize/rich
2,031
comment_to_fix
Add support for named tuples to pretty
Debug print snuck in there.
8e649fea51859e426b2f6300e0a9c88c9c4b6415
5d64431242cfb9529ca36302c91302dd9f22b9b4
diff --git a/rich/pretty.py b/rich/pretty.py index 216075afdc..57f3e62e2c 100644 --- a/rich/pretty.py +++ b/rich/pretty.py @@ -1,4 +1,5 @@ import builtins +import collections import dataclasses import inspect import os @@ -30,7 +31,6 @@ except ImportError: # pragma: no cover _attr_module = None # type: igno...
[ "rich/pretty.py" ]
[ { "comment": "Debug print snuck in there.", "path": "rich/pretty.py", "hunk": "@@ -79,6 +79,24 @@ def _is_dataclass_repr(obj: object) -> bool:\n return False\n \n \n+_dummy_namedtuple = collections.namedtuple(\"_dummy_namedtuple\", [])\n+\n+\n+def _has_default_namedtuple_repr(obj: object) -> boo...
true
Textualize/rich
2,031
comment_to_fix
Add support for named tuples to pretty
You can extend tuples, and named tuples. Perhaps this should just be `if not isinstance(tuple)` ?
8e649fea51859e426b2f6300e0a9c88c9c4b6415
5d64431242cfb9529ca36302c91302dd9f22b9b4
diff --git a/rich/pretty.py b/rich/pretty.py index 216075afdc..57f3e62e2c 100644 --- a/rich/pretty.py +++ b/rich/pretty.py @@ -1,4 +1,5 @@ import builtins +import collections import dataclasses import inspect import os @@ -30,7 +31,6 @@ except ImportError: # pragma: no cover _attr_module = None # type: igno...
[ "rich/pretty.py" ]
[ { "comment": "You can extend tuples, and named tuples. Perhaps this should just be `if not isinstance(tuple)` ?", "path": "rich/pretty.py", "hunk": "@@ -524,6 +543,28 @@ def __str__(self) -> str:\n )\n \n \n+def _is_namedtuple(obj: Any) -> bool:\n+ \"\"\"Checks if an object is most likely...
true
Textualize/rich
2,031
comment_to_fix
Add support for named tuples to pretty
`_fields` *could* be an empty tuple here. For the strange edge-case of a named tuple with no fieds. Perhaps just return `isinstance(fields, tuple)` ?
8e649fea51859e426b2f6300e0a9c88c9c4b6415
5d64431242cfb9529ca36302c91302dd9f22b9b4
diff --git a/rich/pretty.py b/rich/pretty.py index 216075afdc..57f3e62e2c 100644 --- a/rich/pretty.py +++ b/rich/pretty.py @@ -1,4 +1,5 @@ import builtins +import collections import dataclasses import inspect import os @@ -30,7 +31,6 @@ except ImportError: # pragma: no cover _attr_module = None # type: igno...
[ "rich/pretty.py" ]
[ { "comment": "`_fields` *could* be an empty tuple here. For the strange edge-case of a named tuple with no fieds.\r\n\r\nPerhaps just return `isinstance(fields, tuple)` ?", "path": "rich/pretty.py", "hunk": "@@ -524,6 +543,28 @@ def __str__(self) -> str:\n )\n \n \n+def _is_namedtuple(obj: A...
true
Textualize/rich
2,031
comment_to_fix
Add support for named tuples to pretty
print statement...
8e649fea51859e426b2f6300e0a9c88c9c4b6415
5d64431242cfb9529ca36302c91302dd9f22b9b4
diff --git a/rich/pretty.py b/rich/pretty.py index 216075afdc..57f3e62e2c 100644 --- a/rich/pretty.py +++ b/rich/pretty.py @@ -1,4 +1,5 @@ import builtins +import collections import dataclasses import inspect import os @@ -30,7 +31,6 @@ except ImportError: # pragma: no cover _attr_module = None # type: igno...
[ "rich/pretty.py" ]
[ { "comment": "print statement...", "path": "rich/pretty.py", "hunk": "@@ -731,7 +772,24 @@ def iter_attrs() -> Iterable[\n append(child_node)\n \n pop_visited(obj_id)\n-\n+ elif _is_namedtuple(obj) and _has_default_namedtuple_repr(obj):\n+ children =...
true
Textualize/rich
2,031
comment_to_fix
Add support for named tuples to pretty
This can throw a `TypeError` according to the docs. Is that an issue here?
8e649fea51859e426b2f6300e0a9c88c9c4b6415
5d64431242cfb9529ca36302c91302dd9f22b9b4
diff --git a/rich/pretty.py b/rich/pretty.py index 216075afdc..57f3e62e2c 100644 --- a/rich/pretty.py +++ b/rich/pretty.py @@ -1,4 +1,5 @@ import builtins +import collections import dataclasses import inspect import os @@ -30,7 +31,6 @@ except ImportError: # pragma: no cover _attr_module = None # type: igno...
[ "rich/pretty.py" ]
[ { "comment": "This can throw a `TypeError` according to the docs. Is that an issue here?", "path": "rich/pretty.py", "hunk": "@@ -79,6 +79,24 @@ def _is_dataclass_repr(obj: object) -> bool:\n return False\n \n \n+_dummy_namedtuple = collections.namedtuple(\"_dummy_namedtuple\", [])\n+\n+\n+def _...
true
Textualize/rich
2,031
comment_to_fix
Add support for named tuples to pretty
๐Ÿ‘
8e649fea51859e426b2f6300e0a9c88c9c4b6415
5d64431242cfb9529ca36302c91302dd9f22b9b4
diff --git a/rich/pretty.py b/rich/pretty.py index 216075afdc..57f3e62e2c 100644 --- a/rich/pretty.py +++ b/rich/pretty.py @@ -1,4 +1,5 @@ import builtins +import collections import dataclasses import inspect import os @@ -30,7 +31,6 @@ except ImportError: # pragma: no cover _attr_module = None # type: igno...
[ "rich/pretty.py" ]
[ { "comment": "๐Ÿ‘ ", "path": "rich/pretty.py", "hunk": "@@ -524,6 +548,25 @@ def __str__(self) -> str:\n )\n \n \n+def _is_namedtuple(obj: Any) -> bool:\n+ \"\"\"Checks if an object is most likely a namedtuple. It is possible\n+ to craft an object that passes this check and isn't a name...
true
Textualize/rich
1,869
issue_to_patch
Add `Syntax.guess_lexer`, add support for more lexers (e.g. Django templates etc.)
## Type of changes - [x] Bug fix - [x] New feature - [ ] Documentation / docstrings - [ ] Tests - [ ] Other ## Checklist - [x] I've run the latest [black](https://github.com/psf/black) with default args on new code. - [x] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate. - [x] I've added t...
f9d27fce1a0ac61e150b33b851ecb6a7803c61cb
781b41f4a780e70196692d7a43881eef0b0b81e0
diff --git a/CHANGELOG.md b/CHANGELOG.md index f3819a7813..f3e81f7249 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Workaround for edge case of object from Faiss with no `__class__` https://github.com/Textu...
[ "CHANGELOG.md", "rich/syntax.py", "tests/test_syntax.py" ]
[]
diff --git a/tests/test_syntax.py b/tests/test_syntax.py index 834285ac17..a8ac05b6b5 100644 --- a/tests/test_syntax.py +++ b/tests/test_syntax.py @@ -1,17 +1,17 @@ # coding=utf-8 +import os import sys -import os, tempfile +import tempfile import pytest -from .render import render +from pygments.lexers import Py...
true
Textualize/rich
3,122
issue_to_patch
Bump actions/checkout from 2 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 4. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/releases">actions/checkout's releases</a>.</em></p> <blockquote> <h2>v4.0.0</h2> <h2>What's Changed</h2> <ul> <li>Update default runtime ...
720800e6930d85ad027b1e9bd0cbb96b5e994ce3
59ca0e73be08f32763780fa4c40d35b8128c8e98
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 0729ea9ef2..2a973c4c27 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -29,7 +29,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 ...
[ ".github/workflows/codeql.yml", ".github/workflows/codespell.yml", ".github/workflows/newissue.yml", ".github/workflows/pythonpackage.yml", ".github/workflows/readmechanged.yml" ]
[]
true
Textualize/rich
2,160
issue_to_patch
Fall back to `sys.__stderr__` on non-Windows OS to get size
This fixes the "pipe" bug, where we could not determine the available size correctly when the output of Rich is piped to another process ## Type of changes - [x] Bug fix - [ ] New feature - [ ] Documentation / docstrings - [ ] Tests - [ ] Other ## Checklist - [x] I've run the latest [black](https://gith...
41bf6372c5daf3a887a79c77db0aeb1d240a150a
3eac1e47a814deb9bc14b0263070b32c7643d0d0
diff --git a/CHANGELOG.md b/CHANGELOG.md index af96d82f0a..0783de8728 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semanti...
[ "CHANGELOG.md", "CONTRIBUTORS.md", "rich/console.py", "tests/test_console.py" ]
[ { "comment": "maybe we could extract it to a private \"module-scoped\" variable, rather than re-creating it for each invocation of the `size` function? :thinking: ", "path": "rich/console.py", "hunk": "@@ -1102,12 +1102,16 @@ def size(self) -> ConsoleDimensions:\n except OSError: # Probably...
diff --git a/tests/test_console.py b/tests/test_console.py index 82339a3b67..d993ba923e 100644 --- a/tests/test_console.py +++ b/tests/test_console.py @@ -3,7 +3,8 @@ import os import sys import tempfile -from typing import Optional +from typing import Optional, Tuple, Type, Union +from unittest import mock impor...
true
Textualize/rich
2,160
comment_to_fix
Fall back to `sys.__stderr__` on non-Windows OS to get size
looks like we always remove one pixel to the width if this is not forced to `False` ?
41bf6372c5daf3a887a79c77db0aeb1d240a150a
3eac1e47a814deb9bc14b0263070b32c7643d0d0
diff --git a/tests/test_console.py b/tests/test_console.py index 82339a3b67..d993ba923e 100644 --- a/tests/test_console.py +++ b/tests/test_console.py @@ -3,7 +3,8 @@ import os import sys import tempfile -from typing import Optional +from typing import Optional, Tuple, Type, Union +from unittest import mock impor...
[ "tests/test_console.py" ]
[ { "comment": "looks like we always remove one pixel to the width if this is not forced to `False` ?", "path": "tests/test_console.py", "hunk": "@@ -122,6 +123,48 @@ def test_size():\n assert w == 99 and h == 101\n \n \n+@pytest.mark.parametrize(\n+ \"is_windows,no_descriptor_size,stdin_size,stdou...
true
Textualize/rich
2,160
comment_to_fix
Fall back to `sys.__stderr__` on non-Windows OS to get size
The existing `_STD_STREAMS` module-scoped variable is used only for a Windows-specific check; in doubt I've left it as in, without adding `stdin` to it, and just renamed it to `_STD_STREAMS_OUTPUT` to mark the difference with the one I added, which contains `stdin`. As it's explicitly a private variable, we shouldn'...
41bf6372c5daf3a887a79c77db0aeb1d240a150a
3eac1e47a814deb9bc14b0263070b32c7643d0d0
diff --git a/rich/console.py b/rich/console.py index 2cdab42800..ca39a1b2a1 100644 --- a/rich/console.py +++ b/rich/console.py @@ -82,17 +82,21 @@ class NoChange: NO_CHANGE = NoChange() +try: + _STDIN_FILENO = sys.__stdin__.fileno() +except Exception: + _STDIN_FILENO = 0 try: _STDOUT_FILENO = sys.__std...
[ "rich/console.py" ]
[ { "comment": "The existing `_STD_STREAMS` module-scoped variable is used only for a Windows-specific check; in doubt I've left it as in, without adding `stdin` to it, and just renamed it to `_STD_STREAMS_OUTPUT` to mark the difference with the one I added, which contains `stdin`. \r\nAs it's explicitly a priva...
true
Textualize/rich
1,963
issue_to_patch
Fix tests
Update black
588f0331ffa6fee4976b5c33a6dc42f047d5cf85
5dc797e1be21106b8f883ffc40b26cc4393ca64d
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bbae40c844..76f916b96d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,7 +26,7 @@ repos: - id: rst-directive-colons - id: rst-inline-touching-normal - repo: https://github.com/psf/black - rev: 21.12b0 + ...
[ ".pre-commit-config.yaml", "examples/exception.py", "poetry.lock", "rich/filesize.py" ]
[]
true
Textualize/rich
1,925
issue_to_patch
Update CONTRIBUTORS.md and CHANGELOG.md with changes related to addinโ€ฆ
โ€ฆg Progress.get_default_columns ## Type of changes - [ ] Bug fix - [ ] New feature - [X] Documentation / docstrings - [ ] Tests - [ ] Other ## Checklist - [ ] I've run the latest [black](https://github.com/psf/black) with default args on new code. - [X] I've updated CHANGELOG.md and CONTRIBUTORS.md whe...
880693db5b6b5a33c9bdcad35b57afcf37818860
e4f48cc612e35d2fb6bfe9c8c946a80aa2dad564
diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ece575abd..154decdc24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Add support for US spelling of "gray" in ANSI color names https://github.com/Textualize/ri...
[ "CHANGELOG.md", "CONTRIBUTORS.md" ]
[]
true
Textualize/rich
2,820
issue_to_patch
[BUG] List of dataclasses without fields printed as empty list - [x] I've checked [docs](https://rich.readthedocs.io/en/latest/introduction.html) and [closed issues](https://github.com/Textualize/rich/issues?q=is%3Aissue+is%3Aclosed) for possible solutions. - [x] I can't find my issue in the [FAQ](https://github.com/...
fix for empty dataclass
Fixes https://github.com/Textualize/rich/issues/2819
b89d0362e8ebcb18902f0f0a206879f1829b5c0b
da4f6bc797544e30dc6546170d275c7ff6e8380e
diff --git a/CHANGELOG.md b/CHANGELOG.md index 26effda4d2..b8cfd5145c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semanti...
[ "CHANGELOG.md", "rich/pretty.py", "tests/test_pretty.py" ]
[]
diff --git a/tests/test_pretty.py b/tests/test_pretty.py index 53256379ba..46dd57a8a6 100644 --- a/tests/test_pretty.py +++ b/tests/test_pretty.py @@ -175,6 +175,11 @@ class ExampleDataclass: last: int = field(default=1, repr=False) +@dataclass +class Empty: + pass + + def test_pretty_dataclass(): dc ...
true
Textualize/rich
2,977
issue_to_patch
Markdown tables
## Type of changes - [ ] Bug fix - [x] New feature - [ ] Documentation / docstrings - [ ] Tests - [ ] Other ## Checklist - [x] I've run the latest [black](https://github.com/psf/black) with default args on new code. - [x] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate. - [x] I've added t...
68224905f5dc7a3c765e04aba0460b75a95f5004
f3d8e9b72479aaa255039598689d7bead1c5c394
diff --git a/CHANGELOG.md b/CHANGELOG.md index 1792061d7c..5a04d99a33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semant...
[ "CHANGELOG.md", "poetry.lock", "rich/markdown.py", "tests/test_markdown.py", "tools/movies.md" ]
[ { "comment": "Can we use relative imports to match the rest of the code base.", "path": "rich/markdown.py", "hunk": "@@ -4,6 +4,9 @@\n \n from markdown_it import MarkdownIt\n from markdown_it.token import Token\n+from typing_extensions import get_args\n+\n+from rich.table import Table", "resolving_s...
diff --git a/tests/test_markdown.py b/tests/test_markdown.py index 24ad6bc47a..861665cffd 100644 --- a/tests/test_markdown.py +++ b/tests/test_markdown.py @@ -116,6 +116,23 @@ def test_inline_code(): assert result == expected +def test_markdown_table(): + markdown = Markdown( + """\ +| Year | ...
true
Textualize/rich
2,325
issue_to_patch
Fix typo in examples/downloader.py
## Type of changes - [ ] Bug fix - [ ] New feature - [ ] Documentation / docstrings - [ ] Tests - [x] Other ## Checklist - [ ] I've run the latest [black](https://github.com/psf/black) with default args on new code. - [ ] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate. - [ ] I've added t...
e8a9466b94612babc8a437a613614debc1adbea1
2a87610f79d5e39b1dfffd00f549839531cfb562
diff --git a/examples/downloader.py b/examples/downloader.py index 919aa7348f..8a0be50014 100644 --- a/examples/downloader.py +++ b/examples/downloader.py @@ -61,7 +61,7 @@ def copy_url(task_id: TaskID, url: str, path: str) -> None: def download(urls: Iterable[str], dest_dir: str): - """Download multuple files ...
[ "examples/downloader.py" ]
[]
true
Textualize/rich
1,894
issue_to_patch
Add default_columns classmethod to Progress class
## Type of changes - [ ] Bug fix - [x] New feature - [ ] Documentation / docstrings - [ ] Tests - [ ] Other ## Checklist - [x] I've run the latest [black](https://github.com/psf/black) with default args on new code. - [ ] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate. - [x] I've added t...
633faab16dc3a8c01a6562648cc2186c19a476e3
76e234b79d8e8ae2c922c6576856bb5c613ce1e0
diff --git a/rich/progress.py b/rich/progress.py index 1f670db438..fe35b6c175 100644 --- a/rich/progress.py +++ b/rich/progress.py @@ -588,12 +588,7 @@ def __init__( refresh_per_second is None or refresh_per_second > 0 ), "refresh_per_second must be > 0" self._lock = RLock() - self...
[ "rich/progress.py", "tests/test_progress.py" ]
[ { "comment": "Could you change this to `get_default_changes` and add a brief docstring...", "path": "rich/progress.py", "hunk": "@@ -613,6 +608,15 @@ def __init__(\n self.print = self.console.print\n self.log = self.console.log\n \n+ @classmethod\n+ def default_columns(cls) -> Tup...
diff --git a/tests/test_progress.py b/tests/test_progress.py index 2020f91ffb..20b9d32ed4 100644 --- a/tests/test_progress.py +++ b/tests/test_progress.py @@ -334,6 +334,32 @@ def test_columns() -> None: assert result == expected +def test_using_default_columns() -> None: + # can only check types, as the in...
true
Textualize/rich
1,894
comment_to_fix
Add default_columns classmethod to Progress class
Could you change this to `get_default_changes` and add a brief docstring...
633faab16dc3a8c01a6562648cc2186c19a476e3
76e234b79d8e8ae2c922c6576856bb5c613ce1e0
diff --git a/rich/progress.py b/rich/progress.py index 1f670db438..fe35b6c175 100644 --- a/rich/progress.py +++ b/rich/progress.py @@ -588,12 +588,7 @@ def __init__( refresh_per_second is None or refresh_per_second > 0 ), "refresh_per_second must be > 0" self._lock = RLock() - self...
[ "rich/progress.py" ]
[ { "comment": "Could you change this to `get_default_changes` and add a brief docstring...", "path": "rich/progress.py", "hunk": "@@ -613,6 +608,15 @@ def __init__(\n self.print = self.console.print\n self.log = self.console.log\n \n+ @classmethod\n+ def default_columns(cls) -> Tup...
true
Textualize/rich
2,219
issue_to_patch
[BUG] inconsistent coloring of complex numbers Not sure if I should report this as a bug or as a feature request, but there is a very minor issue when printing complex numbers: the decimal part of the imaginary number is uncolored. try for example: ```python >>> from rich import pretty >>> pretty.install() >>...
[highlighter] Add complex numbers pattern to our highlighter's `number` matching
## Type of changes - [x] Bug fix - [ ] New feature - [ ] Documentation / docstrings - [ ] Tests - [ ] Other ## Checklist - [x] I've run the latest [black](https://github.com/psf/black) with default args on new code. - [x] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate. - [x] I've added t...
ed6ff7e9e40aded453f70366b5acfb455ba152b1
a02e5d675227c3cb6a60c77844ee92ca31ee745f
diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ce176a509..638ede8d30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed markup escaping issue https://github.com/Textualize/rich/issues/2187 - Safari - Box appearing ar...
[ "CHANGELOG.md", "rich/default_styles.py", "rich/highlighter.py", "tests/test_highlighter.py" ]
[ { "comment": "Could we call this `\"repr.number.complex\"`", "path": "rich/default_styles.py", "hunk": "@@ -78,6 +78,7 @@\n \"repr.attrib_equal\": Style(bold=True),\n \"repr.attrib_value\": Style(color=\"magenta\", italic=False),\n \"repr.number\": Style(color=\"cyan\", bold=True, italic=Fal...
diff --git a/tests/test_highlighter.py b/tests/test_highlighter.py index 930b340e50..0a036b72f8 100644 --- a/tests/test_highlighter.py +++ b/tests/test_highlighter.py @@ -59,6 +59,40 @@ def test_wrong_type(): (" 1.2 ", [Span(1, 4, "repr.number")]), (" 0xff ", [Span(1, 5, "repr.number")]), (" 1e10 ", [Spa...
true
Textualize/rich
2,219
comment_to_fix
[highlighter] Add complex numbers pattern to our highlighter's `number` matching
Could we call this `"repr.number.complex"`
ed6ff7e9e40aded453f70366b5acfb455ba152b1
a02e5d675227c3cb6a60c77844ee92ca31ee745f
diff --git a/rich/default_styles.py b/rich/default_styles.py index d803eec91d..1969bb787b 100644 --- a/rich/default_styles.py +++ b/rich/default_styles.py @@ -78,6 +78,7 @@ "repr.attrib_equal": Style(bold=True), "repr.attrib_value": Style(color="magenta", italic=False), "repr.number": Style(color="cyan",...
[ "rich/default_styles.py" ]
[ { "comment": "Could we call this `\"repr.number.complex\"`", "path": "rich/default_styles.py", "hunk": "@@ -78,6 +78,7 @@\n \"repr.attrib_equal\": Style(bold=True),\n \"repr.attrib_value\": Style(color=\"magenta\", italic=False),\n \"repr.number\": Style(color=\"cyan\", bold=True, italic=Fal...
true
Textualize/rich
2,219
comment_to_fix
[highlighter] Add complex numbers pattern to our highlighter's `number` matching
We might be able to simplify the regex. What we're formatting is the output of repr strings, which doesn't produce hex (that I'm aware of), so I think we can drop the `0x...` part.
ed6ff7e9e40aded453f70366b5acfb455ba152b1
a02e5d675227c3cb6a60c77844ee92ca31ee745f
diff --git a/rich/highlighter.py b/rich/highlighter.py index 7bee4167e4..193261c4c1 100644 --- a/rich/highlighter.py +++ b/rich/highlighter.py @@ -94,6 +94,7 @@ class ReprHighlighter(RegexHighlighter): r"(?P<call>[\w.]*?)\(", r"\b(?P<bool_true>True)\b|\b(?P<bool_false>False)\b|\b(?P<none>None)...
[ "rich/highlighter.py" ]
[ { "comment": "We might be able to simplify the regex. What we're formatting is the output of repr strings, which doesn't produce hex (that I'm aware of), so I think we can drop the `0x...` part.", "path": "rich/highlighter.py", "hunk": "@@ -94,6 +94,7 @@ class ReprHighlighter(RegexHighlighter):\n ...
true
Textualize/rich
3,775
issue_to_patch
[DOC BUG] `rich.progress.track()` documentation uses "sequence" instead of "iterable" https://rich.readthedocs.io/en/latest/reference/progress.html#rich.progress.track reads: > Parameters: > sequence (Iterable[ProgressType]) โ€“ A sequence (must support โ€œlenโ€) you wish to iterate over. In fact, the `sequence` paramete...
docs and typing
Fixes https://github.com/Textualize/rich/issues/3706
d4a15f081bb12313f31c805fa8228a6a160fa00e
3813c53b9bcff7956b132dde80e5472d2912e3bd
diff --git a/rich/progress.py b/rich/progress.py index a529b24496..ef6ad60f08 100644 --- a/rich/progress.py +++ b/rich/progress.py @@ -29,7 +29,6 @@ NamedTuple, NewType, Optional, - Sequence, TextIO, Tuple, Type, @@ -103,7 +102,7 @@ def __exit__( def track( - sequence: Union[Seq...
[ "rich/progress.py" ]
[]
true
Textualize/rich
2,043
issue_to_patch
reset height of children
Reset height of children in render. Fix for https://github.com/Textualize/rich/issues/2042 When rendering an object with a height, that height is passed to the renderable via options. The problem was that any renderables yielded by `__rich_console__` were passed that same height, which was not intended. This c...
8c6d1cdcc9d00b3f0ae8faacdc5979b0d11f56b6
ebf4c90db699820c32821af2840053ac45d0707b
diff --git a/CHANGELOG.md b/CHANGELOG.md index e3c0933647..70809ac1a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,3 @@ - # Changelog All notable changes to this project will be documented in this file. @@ -6,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is ba...
[ "CHANGELOG.md", "rich/align.py", "rich/console.py", "rich/layout.py", "rich/tabulate.py", "tests/test_console.py", "tests/test_tabulate.py" ]
[ { "comment": "Not exactly an issue but just curious - is this some markdown formatter thing that caused this?", "path": "CHANGELOG.md", "hunk": "@@ -25,14 +24,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0\n - Fix syntax lexer guessing.\n - Fixed Pretty measure no...
diff --git a/tests/test_console.py b/tests/test_console.py index 06fb4a8359..701ccf7402 100644 --- a/tests/test_console.py +++ b/tests/test_console.py @@ -308,7 +308,7 @@ def test_capture(): def test_input(monkeypatch, capsys): - def fake_input(prompt): + def fake_input(prompt=""): console.file.writ...
true
Textualize/rich
1,956
issue_to_patch
Image optimizations
## Type of changes - [ ] Bug fix - [ ] New feature - [ ] Documentation / docstrings - [ ] Tests - [x] Other ## Checklist - [ ] I've run the latest [black](https://github.com/psf/black) with default args on new code. - [ ] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate. - [ ] I've added t...
a6ea98901e3717ac6ab0e7a2799cc56b5c477c88
d369ba5417173f0003f17698dc8fa0404e3faf51
diff --git a/imgs/downloader.gif b/imgs/downloader.gif index 2033d7b981..dad59f2588 100644 Binary files a/imgs/downloader.gif and b/imgs/downloader.gif differ diff --git a/imgs/logo.svg b/imgs/logo.svg index 34c2a11ead..4842c4a8ef 100644 --- a/imgs/logo.svg +++ b/imgs/logo.svg @@ -1,69 +1,1 @@ -<?xml version="1.0" enco...
[ "imgs/downloader.gif", "imgs/logo.svg", "imgs/progress.gif", "imgs/spinners.gif", "imgs/status.gif", "imgs/traceback.png" ]
[]
true
Textualize/rich
1,995
issue_to_patch
Add missing 10.16.2 link
## Type of changes - [x] Documentation / docstrings ## Checklist - [x] I accept that @willmcgugan may be pedantic in the code review. ## Description The 10.16.2 entry in the changelog does not currently have a link associated with its header ๐Ÿ™‚ ![image](https://user-images.githubusercontent.com/25310...
f5ed5bde19cfd9c13c3a9fe5ceefec2c54d66242
f844cb29c24c9fdbee19e377f8d4a8f86897a40e
diff --git a/CHANGELOG.md b/CHANGELOG.md index 48ba5228d8..7c5c243abf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1655,6 +1655,7 @@ Major version bump for a breaking change to `Text.stylize signature`, which corr [11.2.0]: https://github.com/willmcgugan/rich/compare/v11.1.0...v11.2.0 [11.1.0]: https://github.com...
[ "CHANGELOG.md" ]
[]
true
Textualize/rich
1,926
issue_to_patch
task._progress change default_factory to create deque(maxlen=1000), tโ€ฆ
โ€ฆo avoid run-time while loop to trim to length 1000 ## Type of changes - [ ] Bug fix - [ ] New feature - [ ] Documentation / docstrings - [ ] Tests - [X] Other - Performance ## Checklist - [X] I've run the latest [black](https://github.com/psf/black) with default args on new code. - [ ] I've updated CH...
880693db5b6b5a33c9bdcad35b57afcf37818860
e1c595c7e5bd00fc7900471ea13f6de2fa8d165d
diff --git a/rich/progress.py b/rich/progress.py index fe35b6c175..115ae81608 100644 --- a/rich/progress.py +++ b/rich/progress.py @@ -475,7 +475,7 @@ class Task: """Optional[float]: The last speed for a finished task.""" _progress: Deque[ProgressSample] = field( - default_factory=deque, init=False, ...
[ "rich/progress.py" ]
[]
true
Textualize/rich
2,246
issue_to_patch
Render height fix
## Type of changes - [x] Bug fix - [ ] New feature - [ ] Documentation / docstrings - [ ] Tests - [ ] Other ## Checklist - [x] I've run the latest [black](https://github.com/psf/black) with default args on new code. - [x] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate. - [x] I've added t...
da3d59d674f07f4121b5d4f487265185c6f88ed4
8d8532dc934ee4ab1986840791d007fb9f9406f7
diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bb997933c..e14a3690c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Change SVG export to create a simpler SVG +- Fix render_lines crash when render height w...
[ "CHANGELOG.md", "rich/console.py", "tests/test_console.py" ]
[]
diff --git a/tests/test_console.py b/tests/test_console.py index 42d07d0ea1..aa92cc4205 100644 --- a/tests/test_console.py +++ b/tests/test_console.py @@ -20,6 +20,7 @@ ) from rich.control import Control from rich.measure import measure_renderables +from rich.padding import Padding from rich.pager import SystemPage...
true
Textualize/rich
2,001
issue_to_patch
Pycln QA tool as a pre-commit hook
## Type of changes - [ ] Bug fix - [ ] New feature - [ ] Documentation / docstrings - [ ] Tests - [x] Other ## Checklist - [x] I've run the latest [black](https://github.com/psf/black) with default args on new code. - [ ] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate. (not needed for thi...
c1b43f0f18fe0774dbea1b1540d9a875f2f89a3f
5a93a6e08702ae0de2968a5cb704e8701f5df2d5
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 76f916b96d..b7b636be3d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,6 +25,11 @@ repos: - id: python-use-type-annotations - id: rst-directive-colons - id: rst-inline-touching-normal + - repo: https://g...
[ ".pre-commit-config.yaml", "examples/downloader.py", "rich/__init__.py", "rich/_win32_console.py", "rich/_windows.py", "rich/control.py", "rich/highlighter.py", "rich/pager.py", "rich/protocol.py", "rich/traceback.py", "tests/test_ansi.py", "tests/test_live.py", "tests/test_lrucache.py", "...
[]
diff --git a/tests/test_ansi.py b/tests/test_ansi.py index 898286cfab..8b3fa7f770 100644 --- a/tests/test_ansi.py +++ b/tests/test_ansi.py @@ -1,5 +1,3 @@ -import io - from rich.ansi import AnsiDecoder from rich.console import Console from rich.style import Style diff --git a/tests/test_live.py b/tests/test_live.py ...
true
Textualize/rich
2,339
issue_to_patch
[BUG] Console.show_cursor() (and displaying Rich progress bars) clobbers cursor style on Windows **Describe the bug** For some context, I originally discovered this with the Rich progress bars in Twine, that whenever one would display, the cursor style would be clobbered to a block cursor, and reported as pypa/twin...
[win32] Use initial cursor size when hiding or showing it
By doing this the users get their original cursor style back when Rich gives control back to the terminal, rather than a "full size" one Fixes #2333 ## Type of changes - [x] Bug fix - [ ] New feature - [ ] Documentation / docstrings - [ ] Tests - [ ] Other ## Checklist - [x] I've run the latest [bla...
695256ce5316482f15818962ba8f692a460f923f
08ea255fe90e8fe8be069c1d420026cb43030389
diff --git a/CHANGELOG.md b/CHANGELOG.md index 4549ab1b82..88e045948c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fix Rich clobbering cursor style on Windows https://github.com/Textualize/rich/pull/2339 ...
[ "CHANGELOG.md", "rich/_win32_console.py", "tests/test_win32_console.py" ]
[ { "comment": "I replaced the 20+ repeated occurrences of `@patch.object(_win32_console, \"GetConsoleScreenBufferInfo\", return_value=StubScreenBufferInfo)` with a Pytest fixture, which should scale better if we add more patching-that-is-common-to-most-tests in the future .\r\nAt the moment this fixture is in ch...
diff --git a/tests/test_win32_console.py b/tests/test_win32_console.py index 33d4fe48be..a550cb32c6 100644 --- a/tests/test_win32_console.py +++ b/tests/test_win32_console.py @@ -17,6 +17,7 @@ SCREEN_WIDTH = 20 SCREEN_HEIGHT = 30 DEFAULT_STYLE_ATTRIBUTE = 16 + CURSOR_SIZE = 25 @dataclasses.data...
true
Textualize/rich
2,294
issue_to_patch
IndexError: list index out of range when using inspect(pyparsing, all=True) OS: macOS Monterey 12.4 CPU: Intel Python version: `Python 3.10.4 | packaged by conda-forge | (main, Mar 24 2022, 17:43:32) [Clang 12.0.1 ]` `rich` and `pyparsing` version: 12.2.0 and 3.0.8 ``` โฏ conda list rich # packages in envi...
[bugfix] solve crash when using `inspect()` on the "pyparsing" package
## Type of changes - [x] Bug fix - fixes #2284 - [ ] New feature - [ ] Documentation / docstrings - [ ] Tests - [ ] Other :warning: This PR introduces a (minor) breaking change, in order to fix a (minor) issued described with the screenshots below. :point_down: But we can of course choose to keep the exist...
5ccf4ed37686b69aa1412272cfdf60fc10ad9f5d
25d0c0e89829685d2be17043812de82e97c460f7
diff --git a/CHANGELOG.md b/CHANGELOG.md index bc33feab42..f8083da2c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Allow exceptions that are raised while a Live is rendered to be displayed and/or processed...
[ "CHANGELOG.md", "pyproject.toml", "rich/_inspect.py", "rich/control.py", "rich/text.py", "tests/test_control.py", "tests/test_inspect.py" ]
[ { "comment": "while working on this I noticed that creating a Python script with a name starting ending with `test_` anywhere in the project's repo was collected by Pytest: I think we'd better tell Pytest to stick with the contents of our `tests/` folder - which should also make the tests collection faster as a...
diff --git a/tests/test_control.py b/tests/test_control.py index 987206d82e..d2704e9808 100644 --- a/tests/test_control.py +++ b/tests/test_control.py @@ -1,4 +1,4 @@ -from rich.control import Control, strip_control_codes +from rich.control import Control, escape_control_codes, strip_control_codes from rich.segment im...
true
Textualize/rich
2,294
comment_to_fix
[bugfix] solve crash when using `inspect()` on the "pyparsing" package
We pass this dict as a default value of the `_translate_table` (hidden) argument of the `strip_control_codes()` function, but dicts are mutable so we could theoretically have weird side-effects happening - which is picked up by some code analysis tools such as Pycharm's default inspections. Maybe we should ask MyPy/Py...
5ccf4ed37686b69aa1412272cfdf60fc10ad9f5d
25d0c0e89829685d2be17043812de82e97c460f7
diff --git a/rich/control.py b/rich/control.py index 747311fcea..a8a912553a 100644 --- a/rich/control.py +++ b/rich/control.py @@ -1,19 +1,35 @@ +import sys import time from typing import TYPE_CHECKING, Callable, Dict, Iterable, List, Union +if sys.version_info >= (3, 8): + from typing import Final +else: + f...
[ "rich/control.py" ]
[ { "comment": "We pass this dict as a default value of the `_translate_table` (hidden) argument of the `strip_control_codes()` function, but dicts are mutable so we could theoretically have weird side-effects happening - which is picked up by some code analysis tools such as Pycharm's default inspections.\r\nMay...
true
Textualize/rich
2,657
issue_to_patch
[BUG] `Traceback.from_exception` ignores `locals_max_length` and `locals_max_string` arguments ### Describe the bug Specifying `locals_max_length` and `locals_max_string` when using `Traceback.from_exception` has no effect; the defaults `LOCALS_MAX_LENGTH` and `LOCALS_MAX_STRING` are used instead. --- I made a ...
fix for locals max length
Fixes https://github.com/Textualize/rich/issues/2649
73c58a3777774032866b7fe87cc7a214785811fc
af579fdbf277dc7c1b9169ba3494c7224c4efc2e
diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bc3f29746..e1add184d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed issue with `locals_max_length` parameter not being respected in Traceback https://...
[ "CHANGELOG.md", "rich/pretty.py", "rich/traceback.py" ]
[]
true
Textualize/rich
2,037
issue_to_patch
[BUG] Inspecting a NamedTuple defined int the REPL throws an error I suspect this is not exclusive to NamedTuples <img width="1452" alt="Screenshot 2022-03-07 at 15 08 46" src="https://user-images.githubusercontent.com/554369/157060930-7e517028-f587-4c48-906a-a807108a1687.png">
Handle case inspect fails on repl-defined objects
## Type of changes - [x] Bug fix - [ ] New feature - [ ] Documentation / docstrings - [ ] Tests - [ ] Other ## Checklist - [x] I've run the latest [black](https://github.com/psf/black) with default args on new code. - [x] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate. - [ ] I've added t...
8e649fea51859e426b2f6300e0a9c88c9c4b6415
38aa939341484a4b6a782157724bb5a720a0956f
diff --git a/CHANGELOG.md b/CHANGELOG.md index eb6b62623b..dcd9cbdabd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed Pretty measure not respecting expand_all https://github.com/Textualize/rich/issues/1998 - Collap...
[ "CHANGELOG.md", "rich/_inspect.py" ]
[]
true
Textualize/rich
2,458
issue_to_patch
Handle 'no_color' Console on legacy Windows platforms
## Type of changes - [x] Bug fix - [ ] New feature - [ ] Documentation / docstrings - [ ] Tests - [ ] Other ## Checklist - [x] I've run the latest [black](https://github.com/psf/black) with default args on new code. - [x] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate. - [ ] I've added t...
33040731973d44cf6326d4b88e697f79dbdc4e9a
42afd3aedf32e1357e336147d37b4f7dbdfe85ae
diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index dbadb79d8a..40685a56ed 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [windows-latest, ubuntu-latest, macos-latest] - ...
[ ".github/workflows/pythonpackage.yml", "CHANGELOG.md", "rich/console.py" ]
[]
true
Textualize/rich
3,777
issue_to_patch
TTY_INTERACTIVE env var
Adds a `TTY_INTERACTIVE` to disable things like progress bar / status spinners in CI This adds to the new `TTY_COMPATIBLE` which enables styles even when the file is not technically a tty, as is the case in Github Actions. `TTY_INTERACTIVE=0` will remove superfluous animations and progress bars in the CI output.
49117ced6648a432d85951f72dce777038f6ce09
b46bd78ee5c665172d936adca111a9b54420f675
diff --git a/CHANGELOG.md b/CHANGELOG.md index 490857b35c..c5b1877289 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed extraction of recursive exceptions https://github.com/Textualize/rich/pull/3772 +### Added +...
[ "CHANGELOG.md", "docs/source/console.rst", "rich/console.py", "rich/diagnose.py", "tests/test_console.py" ]
[]
diff --git a/tests/test_console.py b/tests/test_console.py index 10576b2dae..499043b312 100644 --- a/tests/test_console.py +++ b/tests/test_console.py @@ -1038,6 +1038,31 @@ def test_capture_and_record() -> None: assert recorded_content == "Print 0\n" +def test_tty_interactive() -> None: + """Check TTY_INTE...
true
Textualize/rich
2,000
issue_to_patch
Collapsed definitions for single-character spinners, to save memory aโ€ฆ
โ€ฆnd reduce import time. ## Type of changes - [ ] Bug fix - [ ] New feature - [ ] Documentation / docstrings - [ ] Tests - [X] Other - performance and memory reduction ## Checklist - [X] I've run the latest [black](https://github.com/psf/black) with default args on new code. - [X] I've updated CHANGELOG...
4b3b6531ad349312f4df6e284bc1831dcf59ada6
22c26af57591408469e247e3de08a7620068e6d1
diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c5c243abf..d63fa0871d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add support for enum.Flag in ReprHighlighter https://github.com/Textualize/rich/pull/1920 +### Fix...
[ "CHANGELOG.md", "rich/_spinners.py" ]
[]
true
Textualize/rich
3,716
issue_to_patch
docs: update supported python versions
Update the badge in the README for currently supported Python versions. Also update the required Python version in the [docs introduction](https://rich.readthedocs.io/en/latest/introduction.html#requirements). ## Type of changes - [ ] Bug fix - [ ] New feature - [x] Documentation / docstrings - [ ] Tests -...
0c6c75644f80530de219dae3e94f0aeb999f9b4c
c45f73ae26f76af444265500f5607869b1fc369b
diff --git a/README.md b/README.md index 349f53a041..fff791b544 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Supported Python Versions](https://img.shields.io/pypi/pyversions/rich/13.2.0)](https://pypi.org/project/rich/) [![PyPI version](https://badge.fury.io/py/rich.svg)](https://badge.fury.io/py/rich) +...
[ "README.md", "docs/source/introduction.rst" ]
[]
true
Textualize/rich
2,397
issue_to_patch
Print cause of exceptions even when they have no traceback
Exceptions from subprocesses raised by 'multiprocessing' don't include a traceback, so rich doesn't currently print them. They contain important information though, so this PR enables printing the exception without the traceback. This works because `walk_tb` doesn't do anything if the input is `None`. Minimal exampl...
2e8b217fdaa494572bc59ed517f5bd9b1281f810
0817587669a9f75cb58f836ac1f1255cc289e9df
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 8b49afe5e1..e68a05b419 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -43,6 +43,7 @@ The following people have contributed to the development of Rich: - [Nicolas Simonds](https://github.com/0xDEC0DE) - [Aaron Stephens](https://github.com/aaronst) - [Gabriel...
[ "CONTRIBUTORS.md", "rich/traceback.py" ]
[]
true
Textualize/rich
2,449
issue_to_patch
[REQUEST] Enable colours when FORCE_COLOR env var is set Have you checked the issues for a similar suggestions? Yes, initially rejected at https://github.com/Textualize/rich/issues/343 but further discussed more favourably at https://github.com/pypa/pip/issues/10909#issuecomment-1125169879. **How would you impro...
Force color
## Type of changes - [ ] Bug fix - [x] New feature - [ ] Documentation / docstrings - [ ] Tests - [ ] Other ## Checklist - [x] I've run the latest [black](https://github.com/psf/black) with default args on new code. - [x] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate. - [x] I've added t...
5d3f600f43796393a2c3e4cb20d807c5cf147f44
193266c1b7d954bbc98533e7b3d2609e5dee0d7d
diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b2800e89e..4b95a4790e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semanti...
[ "CHANGELOG.md", "rich/console.py", "tests/test_console.py" ]
[]
diff --git a/tests/test_console.py b/tests/test_console.py index 2db88af0b4..07692f1986 100644 --- a/tests/test_console.py +++ b/tests/test_console.py @@ -895,3 +895,11 @@ def test_render_lines_height_minus_vertical_pad_is_negative(): # Ensuring that no exception is raised... console.render_lines(Padding("h...
true
Textualize/rich
2,567
issue_to_patch
Drop Python 3.6 as a supported version of Python Time to drop Python 3.6 as a version of Python supported by Rich. The reasons for doing so include: - Python 3.6 [reached end-of-life on 2021-12-03](https://devguide.python.org/versions/) - The Poetry installer used for our GitHub actions [recently dropped 3.6](http...
Drop Python 3.6 as the minimum-supported Python version
Implements the requirements outlined in #2566.
42988b834f9c76b63145dd8d8142a94243e71375
4d084d5d1cd126c6528cec6f88d37446ff87ba37
diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 4deab7ae74..e45bdb929c 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [windows-latest, ubuntu-latest, macos-latest] - ...
[ ".github/workflows/pythonpackage.yml", "CHANGELOG.md", "README.md", "poetry.lock", "pyproject.toml", "rich/_null_file.py", "rich/highlighter.py", "rich/rule.py", "tests/test_null_file.py" ]
[]
diff --git a/tests/test_null_file.py b/tests/test_null_file.py index 5f11e4f910..001c89bd38 100644 --- a/tests/test_null_file.py +++ b/tests/test_null_file.py @@ -5,9 +5,6 @@ def test_null_file(): file = NullFile() with file: assert file.write("abc") == 0 - assert file.mode == "" - asse...
true
Textualize/rich
3,519
issue_to_patch
docs(table): add column highlight option
## Type of changes - [ ] Bug fix - [ ] New feature - [x] Documentation / docstrings - [ ] Tests - [ ] Other ## Checklist - [ ] I've run the latest [black](https://github.com/psf/black) with default args on new code. - [ ] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate. - [ ] I've added t...
5ba9cb56e68dcdf2db50c214d8f1412c8a50761b
0176befbbab4b5515e72fad924540e247fc591cb
diff --git a/docs/source/tables.rst b/docs/source/tables.rst index f573dbc62a..c0fd4e4b08 100644 --- a/docs/source/tables.rst +++ b/docs/source/tables.rst @@ -142,6 +142,7 @@ There are a number of options you can set on a column to modify how it will look - ``max_width`` When set to an integer will prevent the column ...
[ "docs/source/tables.rst" ]
[]
true
Textualize/rich
1,920
issue_to_patch
Fix repr highlighter
## Type of changes - [X] Bug fix - [ ] New feature - [ ] Documentation / docstrings - [ ] Tests - [X] Other ## Checklist - [X] I've run the latest [black](https://github.com/psf/black) with default args on new code. - [X] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate. - [X] I've added t...
3be88c08964c97b3ae64786e38a56567a97c439a
099893e8b115b6e75334d17fd3dcefe7004b0289
diff --git a/CHANGELOG.md b/CHANGELOG.md index fcf58cd7a1..9f22ffda5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - In Jupyter mode make the link target be set to "_blank" +### Added + +- Add support for enum.Flag ...
[ "CHANGELOG.md", "CONTRIBUTORS.md", "rich/highlighter.py", "tests/test_highlighter.py" ]
[]
diff --git a/tests/test_highlighter.py b/tests/test_highlighter.py index 99793723c8..c5303b5c0c 100644 --- a/tests/test_highlighter.py +++ b/tests/test_highlighter.py @@ -40,6 +40,16 @@ def test_wrong_type(): Span(4, 9, "repr.str"), ], ), + ( + "<Permission.WRITE|READ: 3>", + ...
true
Textualize/rich
3,681
issue_to_patch
bump to 14.0.0
## Type of changes - [ ] Bug fix - [ ] New feature - [ ] Documentation / docstrings - [ ] Tests - [ ] Other ## Checklist - [ ] I've run the latest [black](https://github.com/psf/black) with default args on new code. - [ ] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate. - [ ] I've added t...
2bae2fe3d861ef83d778c289f6e1e17733225b76
859d77bd6fbe67a72ddeacc300c85deed3b26598
diff --git a/CHANGELOG.md b/CHANGELOG.md index b84fce7f0d..10933867af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic...
[ "CHANGELOG.md", "pyproject.toml" ]
[]
true
Textualize/rich
2,331
issue_to_patch
Bump mypy from 0.950 to 0.961
Bumps [mypy](https://github.com/python/mypy) from 0.950 to 0.961. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/python/mypy/commit/89bdcfb8c658340dae70312c5b76b703838d8123"><code>89bdcfb</code></a> Update version to 0.961</li> <li><a href="https://github.com/python/mypy/commit/154ac75150c933...
e8a9466b94612babc8a437a613614debc1adbea1
b4346ba77978a9798505fbc6b55fd4398009b5d6
diff --git a/poetry.lock b/poetry.lock index 30edc19b15..0d7091f2bf 100644 --- a/poetry.lock +++ b/poetry.lock @@ -490,7 +490,7 @@ python-versions = "*" [[package]] name = "mypy" -version = "0.950" +version = "0.961" description = "Optional static typing for Python" category = "dev" optional = false @@ -1065,7 +...
[ "poetry.lock", "pyproject.toml" ]
[]
true
Textualize/rich
3,139
issue_to_patch
enable py312
Updating for Python3.12
ec91917deb47b43188312e0e3f03bbab7e4e2e7e
3f8c4af45133590590257de90fcbdc40834c0775
diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 79ad51e672..829c09865c 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [windows-latest, ubuntu-latest, macos-latest] - ...
[ ".github/workflows/pythonpackage.yml", "poetry.lock", "pyproject.toml", "tests/_card_render.py", "tests/test_card.py", "tests/test_inspect.py", "tests/test_markdown.py", "tests/test_markdown_no_hyperlinks.py", "tests/test_pretty.py", "tests/test_syntax.py" ]
[]
diff --git a/tests/_card_render.py b/tests/_card_render.py index 9d3ceeedfe..501c952334 100644 --- a/tests/_card_render.py +++ b/tests/_card_render.py @@ -1,1 +1,1 @@ -expected = "\x1b[3m Rich features \x1b[0m\n\x1b[1;31m ...
true
TheAlgorithms/C-Plus-Plus
3,012
issue_to_patch
correct grammar and wording in contribution guidelines
#### Description of Change Fixed a small grammatical issue in the **CONTRIBUTING.md** file: - Changed > **New implementation** New implementations are welcome! to > **New implementation** We welcome new implementations! This improves readability and consistency. #### Checklist <!-- Remove it...
be550cd9126370ac45a54d15e2ce3bc00e45fa28
17eb3b03186debb4da2c47129c330a1569763b15
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 13dea32342..82d895c69f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,8 @@ Being a contributor at The Algorithms, we request you to follow the points menti - Your work will be distributed under the [MIT License](https://github.com/TheAlgorithms/C-Pl...
[ "CONTRIBUTING.md" ]
[]
true
TheAlgorithms/C-Plus-Plus
3,009
issue_to_patch
style: remove interaction with the user
#### Description of Change <!-- Thank you for your Pull Request. Please provide a description above and review the requirements below. Contributors guide: https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/CONTRIBUTING.md --> It makes this file more CI-friendly (i.e. can help with #2753) - now it can be...
ba0d3fff49eb83150efa1253366025c9549c60ae
732e26579522f6e77b31cab83757e0585934cc09
diff --git a/math/vector_cross_product.cpp b/math/vector_cross_product.cpp index 391faceb8f..604a53cf9a 100644 --- a/math/vector_cross_product.cpp +++ b/math/vector_cross_product.cpp @@ -1,19 +1,22 @@ /** * @file * - * @brief Calculates the [Cross Product](https://en.wikipedia.org/wiki/Cross_product) and the magni...
[ "math/vector_cross_product.cpp" ]
[ { "comment": "Add a test for A โจฏ A\n```suggestion\n\n /// Tests A โจฏ A = 0\n std::array<double, 3> t_vec2 =\n math::vector_cross::cross({1, 2, 3}, {1, 2, 3});\n assert(t_vec2[0] == 0 && t_vec2[1] == 0 &&\n t_vec2[2] == 0); // checking each element\n assert(math::vector_cross::mag(t_...
true
TheAlgorithms/C-Plus-Plus
3,009
comment_to_fix
style: remove interaction with the user
Add a test for A โจฏ A ```suggestion /// Tests A โจฏ A = 0 std::array<double, 3> t_vec2 = math::vector_cross::cross({1, 2, 3}, {1, 2, 3}); assert(t_vec2[0] == 0 && t_vec2[1] == 0 && t_vec2[2] == 0); // checking each element assert(math::vector_cross::mag(t_vec2) == 0); // ch...
ba0d3fff49eb83150efa1253366025c9549c60ae
732e26579522f6e77b31cab83757e0585934cc09
diff --git a/math/vector_cross_product.cpp b/math/vector_cross_product.cpp index 391faceb8f..604a53cf9a 100644 --- a/math/vector_cross_product.cpp +++ b/math/vector_cross_product.cpp @@ -1,19 +1,22 @@ /** * @file * - * @brief Calculates the [Cross Product](https://en.wikipedia.org/wiki/Cross_product) and the magni...
[ "math/vector_cross_product.cpp" ]
[ { "comment": "Add a test for A โจฏ A\n```suggestion\n\n /// Tests A โจฏ A = 0\n std::array<double, 3> t_vec2 =\n math::vector_cross::cross({1, 2, 3}, {1, 2, 3});\n assert(t_vec2[0] == 0 && t_vec2[1] == 0 &&\n t_vec2[2] == 0); // checking each element\n assert(math::vector_cross::mag(t_...
true
TheAlgorithms/C-Plus-Plus
3,017
issue_to_patch
[BUG] Approved label CI does not add approved label to pull requests. ### Description As the title suggests the approved label CI does not add approved label to the pull requests ### Expected behavior add an approved label when the pull request is approved ### Actual behavior 403 unable to access resource ### St...
ci: fix permissions issue with approved-label
#### Description of Change closes #2719 #### Checklist <!-- Remove items that do not apply. For completed items, change [ ] to [x]. --> - [x] Added description of change - [x] PR title follows semantic [commit guidelines](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/CONTRIBUTING.md#Commit-Guidelin...
b5d818b15fda34571d938769d6d79afdd45d2209
2907f81fa217305de196d9aa2a7e576abc4f996b
diff --git a/.github/workflows/approved-label.yml b/.github/workflows/approved-label.yml index 850da4e5bf..9ce4225cb4 100644 --- a/.github/workflows/approved-label.yml +++ b/.github/workflows/approved-label.yml @@ -1,5 +1,7 @@ on: pull_request_review name: Add "approved" label when approved +permissions: + pull-requ...
[ ".github/workflows/approved-label.yml" ]
[]
true
TheAlgorithms/C-Plus-Plus
3,016
issue_to_patch
[BUG] Approved label CI does not add approved label to pull requests. ### Description As the title suggests the approved label CI does not add approved label to the pull requests ### Expected behavior add an approved label when the pull request is approved ### Actual behavior 403 unable to access resource ### St...
ci: use a different action for approved-label workflow
#### Description of Change Recently the label on approved action has been deleted, For a long time now it has not been working properly and now has started openly failing. This PR fixes the issue by creating the same action using modern JavaScript and action toolkit. uses [label as approved](https://www.github.com...
35021501ff92a228106255396a4a4d113103d6da
21e1ed47f28393ff65f0b97e2152b537c79fe36f
diff --git a/.github/workflows/approved-label.yml b/.github/workflows/approved-label.yml index 9fbc5ed0ae..850da4e5bf 100644 --- a/.github/workflows/approved-label.yml +++ b/.github/workflows/approved-label.yml @@ -5,10 +5,9 @@ jobs: name: Add "approved" label when approved runs-on: ubuntu-latest steps: ...
[ ".github/workflows/approved-label.yml" ]
[]
true
TheAlgorithms/C-Plus-Plus
3,006
issue_to_patch
style: remove interaction with the user
Helps with #2753 #### Description of Change <!-- Thank you for your Pull Request. Please provide a description above and review the requirements below. Contributors guide: https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/CONTRIBUTING.md --> It makes this file more CI-friendly (i.e. can help with #2...
8541bb367440dea46d58953f6561d9dd480a5249
fb94611aa460098e60794b0454e21ba71efb7c92
diff --git a/math/number_of_positive_divisors.cpp b/math/number_of_positive_divisors.cpp index 9407c4dc8d..6d8f858967 100644 --- a/math/number_of_positive_divisors.cpp +++ b/math/number_of_positive_divisors.cpp @@ -23,7 +23,6 @@ **/ #include <cassert> -#include <iostream> /** * Function to compute the number o...
[ "math/number_of_positive_divisors.cpp" ]
[]
true
TheAlgorithms/C-Plus-Plus
3,008
issue_to_patch
ci: bump codeql to v3
#### Description of Change CodeQL V2 has been [deprecated](https://github.blog/changelog/2025-01-10-code-scanning-codeql-action-v2-is-now-deprecated/) #### Checklist <!-- Remove items that do not apply. For completed items, change [ ] to [x]. --> - [x] Added description of change - [x] PR title follows semantic [comm...
47badd959e82a105ef03e99ee8ceee216b27f129
42e90465ba3e15331c4e8ab3c53848bd99eb71e3
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 2b40ac59304..2029303387e 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -15,7 +15,7 @@ on: # โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ # โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ # * * * * * - - cron: '30 1 * * 0' + - cron: "30...
[ ".github/workflows/codeql.yml" ]
[]
true
TheAlgorithms/C-Plus-Plus
3,007
issue_to_patch
chore: fix file formatter
#### Description of Change ## fault File formatter always exits early becuase of unreachable code, Intially while copying this script from the workflow file(#2500) the indentation was not proper ## fix removed the unneccessary indentation #### Checklist <!-- Remove items that do not apply. For completed items, chang...
643e0a96e05295e2798d47dcbcf9b43b81e23de1
e9c5e6eca01131059c603b97f786eda24d0bd565
diff --git a/scripts/file_linter.py b/scripts/file_linter.py index 8414221b829..cfa98a4b93f 100644 --- a/scripts/file_linter.py +++ b/scripts/file_linter.py @@ -6,34 +6,44 @@ with open("git_diff.txt") as in_file: modified_files = sorted(in_file.read().splitlines()) print("{} files were modified.".format(len(...
[ "scripts/file_linter.py" ]
[]
true
TheAlgorithms/C-Plus-Plus
3,003
issue_to_patch
Return type inconsistency ### Issue I've identified two issues in the bit_manipulation/count_of_set_bits.cpp repository file. The first is a return type mismatch: the function returns an int, but the documented type is uint64_t. The second is an erroneous documentation link, which directs to the count-set-bits proble...
Fix: use uint64_t for input and counter in countSetBits
#### Description of Change Updated the `countSetBits` function in bit_manipulation/count_of_set_bits.cpp to improve **type safety and correctness**: - Changed the input parameter from `int64_t` to `uint64_t` to ensure only non-negative numbers are allowed. - Changed the internal counter variable `count` from `in...
e72b7aa4e8c484de5a91c66717d84ad18000ee8c
18826aab352c7199e94f0534b38932282938ac80
diff --git a/bit_manipulation/count_of_set_bits.cpp b/bit_manipulation/count_of_set_bits.cpp index dd29fd8bf1..dfc4d7fec7 100644 --- a/bit_manipulation/count_of_set_bits.cpp +++ b/bit_manipulation/count_of_set_bits.cpp @@ -36,11 +36,19 @@ namespace count_of_set_bits { * @returns total number of set-bits in the binary...
[ "bit_manipulation/count_of_set_bits.cpp" ]
[]
true
TheAlgorithms/C-Plus-Plus
3,005
issue_to_patch
fix: handle wrong inputs in `postfix_evaluation`
#### Description of Change <!-- Thank you for your Pull Request. Please provide a description above and review the requirements below. Contributors guide: https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/CONTRIBUTING.md --> The previous version of the code did not handle properly the incorrect inputs ...
07663b019b592509cc69048bfcf3af4761ec13e5
df29b75cf2f862bfdfad6b54975b0f0960bd1c5a
diff --git a/others/postfix_evaluation.cpp b/others/postfix_evaluation.cpp index 9132b9b03e..7d35158567 100644 --- a/others/postfix_evaluation.cpp +++ b/others/postfix_evaluation.cpp @@ -77,6 +77,17 @@ void evaluate(float a, float b, const std::string &operation, } } +namespace { +float remove_from_stack(std::s...
[ "others/postfix_evaluation.cpp" ]
[]
true
TheAlgorithms/C-Plus-Plus
2,996
issue_to_patch
refactor: input size should not be a template argument in `postfix_evaluation`
#### Description of Change <!-- Thank you for your Pull Request. Please provide a description above and review the requirements below. Contributors guide: https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/CONTRIBUTING.md --> Since the input size of [`postfix_evaluation`](https://github.com/vil02/C-Plus...
0301b4cd17cdfb4b12022d921d130ee92d453f8b
ad60004571085e75fd039b04dd004dc82e529d62
diff --git a/others/postfix_evaluation.cpp b/others/postfix_evaluation.cpp index 722f0d330a..9132b9b03e 100644 --- a/others/postfix_evaluation.cpp +++ b/others/postfix_evaluation.cpp @@ -12,11 +12,11 @@ * When the expression is ended, the number in the stack is the final answer */ #include <algorithm> // for all_...
[ "others/postfix_evaluation.cpp" ]
[]
true
TheAlgorithms/C-Plus-Plus
2,959
issue_to_patch
Added a bit manipulation program to determine even or odd numbers
#### Description of Change Previously, the repository did not include an implementation for checking whether a number is even or odd using bit manipulation techniques. I have created a new file and added the code to perform this check using bitwise operations. file location for ref: `bit_manipulation/check_even_odd.c...
3aafade824d9f615fcf63b3f22fe8d6f7652fec0
034a525837d6b74fb8243e402ed9feebf1e0ef78
diff --git a/bit_manipulation/check_even_odd.cpp b/bit_manipulation/check_even_odd.cpp new file mode 100644 index 00000000000..17ad0707cac --- /dev/null +++ b/bit_manipulation/check_even_odd.cpp @@ -0,0 +1,93 @@ +/** + * @file + * @brief Implementation to [Check if a number is Even or Odd using Bitwise Operator] + * (h...
[ "bit_manipulation/check_even_odd.cpp" ]
[ { "comment": "you could give an example here with an 8 bit binary number and show how when the lsb is 1 its an odd number and even number when lsb is 0", "path": "bit_manipulation/check_even_odd.cpp", "hunk": "@@ -0,0 +1,88 @@\n+/**\n+ * @file\n+ * @brief Implementation to [Check if a number is Even or ...
true
TheAlgorithms/C-Plus-Plus
2,959
comment_to_fix
Added a bit manipulation program to determine even or odd numbers
you could give an example here with an 8 bit binary number and show how when the lsb is 1 its an odd number and even number when lsb is 0
3aafade824d9f615fcf63b3f22fe8d6f7652fec0
034a525837d6b74fb8243e402ed9feebf1e0ef78
diff --git a/bit_manipulation/check_even_odd.cpp b/bit_manipulation/check_even_odd.cpp new file mode 100644 index 00000000000..17ad0707cac --- /dev/null +++ b/bit_manipulation/check_even_odd.cpp @@ -0,0 +1,93 @@ +/** + * @file + * @brief Implementation to [Check if a number is Even or Odd using Bitwise Operator] + * (h...
[ "bit_manipulation/check_even_odd.cpp" ]
[ { "comment": "you could give an example here with an 8 bit binary number and show how when the lsb is 1 its an odd number and even number when lsb is 0", "path": "bit_manipulation/check_even_odd.cpp", "hunk": "@@ -0,0 +1,88 @@\n+/**\n+ * @file\n+ * @brief Implementation to [Check if a number is Even or ...
true
TheAlgorithms/C-Plus-Plus
2,959
comment_to_fix
Added a bit manipulation program to determine even or odd numbers
```suggestion #include <cassert> /// for assert #include <cstdint> /// for uint32_t #include <iostream> /// for IO operations #include <string> /// for std::string ```
3aafade824d9f615fcf63b3f22fe8d6f7652fec0
034a525837d6b74fb8243e402ed9feebf1e0ef78
diff --git a/bit_manipulation/check_even_odd.cpp b/bit_manipulation/check_even_odd.cpp new file mode 100644 index 00000000000..17ad0707cac --- /dev/null +++ b/bit_manipulation/check_even_odd.cpp @@ -0,0 +1,93 @@ +/** + * @file + * @brief Implementation to [Check if a number is Even or Odd using Bitwise Operator] + * (h...
[ "bit_manipulation/check_even_odd.cpp" ]
[ { "comment": "```suggestion\r\n#include <cassert> /// for assert\r\n#include <cstdint> /// for uint32_t\r\n#include <iostream> /// for IO operations\r\n#include <string> /// for std::string\r\n```", "path": "bit_manipulation/check_even_odd.cpp", "hunk": "@@ -0,0 +1,88 @@\n+/**\n+ * @file\n+ * @b...
true
TheAlgorithms/C-Plus-Plus
2,959
comment_to_fix
Added a bit manipulation program to determine even or odd numbers
```suggestion bool checkEvenOdd(std::int64_t N) { ```
3aafade824d9f615fcf63b3f22fe8d6f7652fec0
034a525837d6b74fb8243e402ed9feebf1e0ef78
diff --git a/bit_manipulation/check_even_odd.cpp b/bit_manipulation/check_even_odd.cpp new file mode 100644 index 00000000000..17ad0707cac --- /dev/null +++ b/bit_manipulation/check_even_odd.cpp @@ -0,0 +1,93 @@ +/** + * @file + * @brief Implementation to [Check if a number is Even or Odd using Bitwise Operator] + * (h...
[ "bit_manipulation/check_even_odd.cpp" ]
[ { "comment": "```suggestion\r\n bool checkEvenOdd(std::int64_t N) {\r\n```", "path": "bit_manipulation/check_even_odd.cpp", "hunk": "@@ -0,0 +1,88 @@\n+/**\n+ * @file\n+ * @brief Implementation to [Check if a number is Even or Odd using Bitwise Operator]\n+ * (https://www.log2base2.com/c-examples...
true
TheAlgorithms/C-Plus-Plus
2,959
comment_to_fix
Added a bit manipulation program to determine even or odd numbers
```suggestion return (N & 1) == 0; ```
3aafade824d9f615fcf63b3f22fe8d6f7652fec0
034a525837d6b74fb8243e402ed9feebf1e0ef78
diff --git a/bit_manipulation/check_even_odd.cpp b/bit_manipulation/check_even_odd.cpp new file mode 100644 index 00000000000..17ad0707cac --- /dev/null +++ b/bit_manipulation/check_even_odd.cpp @@ -0,0 +1,93 @@ +/** + * @file + * @brief Implementation to [Check if a number is Even or Odd using Bitwise Operator] + * (h...
[ "bit_manipulation/check_even_odd.cpp" ]
[ { "comment": "```suggestion\r\n return (N & 1) == 0;\r\n```", "path": "bit_manipulation/check_even_odd.cpp", "hunk": "@@ -0,0 +1,88 @@\n+/**\n+ * @file\n+ * @brief Implementation to [Check if a number is Even or Odd using Bitwise Operator]\n+ * (https://www.log2base2.com/c-examples/bitwise/od...
true
TheAlgorithms/C-Plus-Plus
2,959
comment_to_fix
Added a bit manipulation program to determine even or odd numbers
```suggestion ```
3aafade824d9f615fcf63b3f22fe8d6f7652fec0
034a525837d6b74fb8243e402ed9feebf1e0ef78
diff --git a/bit_manipulation/check_even_odd.cpp b/bit_manipulation/check_even_odd.cpp new file mode 100644 index 00000000000..17ad0707cac --- /dev/null +++ b/bit_manipulation/check_even_odd.cpp @@ -0,0 +1,93 @@ +/** + * @file + * @brief Implementation to [Check if a number is Even or Odd using Bitwise Operator] + * (h...
[ "bit_manipulation/check_even_odd.cpp" ]
[ { "comment": "```suggestion\r\n```", "path": "bit_manipulation/check_even_odd.cpp", "hunk": "@@ -0,0 +1,88 @@\n+/**\n+ * @file\n+ * @brief Implementation to [Check if a number is Even or Odd using Bitwise Operator]\n+ * (https://www.log2base2.com/c-examples/bitwise/odd-or-even-program-in-c-using-bitwise...
true
TheAlgorithms/C-Plus-Plus
2,959
comment_to_fix
Added a bit manipulation program to determine even or odd numbers
```suggestion std::string is_even(std::int64_t N) { ```
3aafade824d9f615fcf63b3f22fe8d6f7652fec0
034a525837d6b74fb8243e402ed9feebf1e0ef78
diff --git a/bit_manipulation/check_even_odd.cpp b/bit_manipulation/check_even_odd.cpp new file mode 100644 index 00000000000..17ad0707cac --- /dev/null +++ b/bit_manipulation/check_even_odd.cpp @@ -0,0 +1,93 @@ +/** + * @file + * @brief Implementation to [Check if a number is Even or Odd using Bitwise Operator] + * (h...
[ "bit_manipulation/check_even_odd.cpp" ]
[ { "comment": "```suggestion\r\n std::string is_even(std::int64_t N) {\r\n```", "path": "bit_manipulation/check_even_odd.cpp", "hunk": "@@ -0,0 +1,88 @@\n+/**\n+ * @file\n+ * @brief Implementation to [Check if a number is Even or Odd using Bitwise Operator]\n+ * (https://www.log2base2.com/c-exampl...
true
TheAlgorithms/C-Plus-Plus
2,959
comment_to_fix
Added a bit manipulation program to determine even or odd numbers
```suggestion bool is_even(std::int64_t N) { ```
3aafade824d9f615fcf63b3f22fe8d6f7652fec0
034a525837d6b74fb8243e402ed9feebf1e0ef78
diff --git a/bit_manipulation/check_even_odd.cpp b/bit_manipulation/check_even_odd.cpp new file mode 100644 index 00000000000..17ad0707cac --- /dev/null +++ b/bit_manipulation/check_even_odd.cpp @@ -0,0 +1,93 @@ +/** + * @file + * @brief Implementation to [Check if a number is Even or Odd using Bitwise Operator] + * (h...
[ "bit_manipulation/check_even_odd.cpp" ]
[ { "comment": "```suggestion\r\n bool is_even(std::int64_t N) {\r\n```", "path": "bit_manipulation/check_even_odd.cpp", "hunk": "@@ -0,0 +1,93 @@\n+/**\n+ * @file\n+ * @brief Implementation to [Check if a number is Even or Odd using Bitwise Operator]\n+ * (https://www.log2base2.com/c-examples/bitw...
true
TheAlgorithms/C-Plus-Plus
2,995
issue_to_patch
fix: remove potential segv from `postfix_evaluation.cpp`
#### Description of Change <!-- Thank you for your Pull Request. Please provide a description above and review the requirements below. Contributors guide: https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/CONTRIBUTING.md --> The [`Stack`](https://github.com/TheAlgorithms/C-Plus-Plus/blob/43ce63682a087b...
43ce63682a087b17e01b945aaa3fa7a51c36f82c
8c0db63481ad1103e32872fcb4d2783c346e76ee
diff --git a/others/postfix_evaluation.cpp b/others/postfix_evaluation.cpp index 1ea77c6f8a5..722f0d330a0 100644 --- a/others/postfix_evaluation.cpp +++ b/others/postfix_evaluation.cpp @@ -1,6 +1,7 @@ /** * @file - * @brief Evaluation of [Postfix Expression](https://en.wikipedia.org/wiki/Reverse_Polish_notation) + *...
[ "others/postfix_evaluation.cpp" ]
[]
true
TheAlgorithms/C-Plus-Plus
2,994
issue_to_patch
fix: remove potential segv from `factorial_memoization`
#### Description of Change <!-- Thank you for your Pull Request. Please provide a description above and review the requirements below. Contributors guide: https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/CONTRIBUTING.md --> [`factorial_memoization.cpp`](https://github.com/TheAlgorithms/C-Plus-Plus/blob/...
63aa8595cd209cd525abbe0f9c318bd7fbb074ea
11347b2667569e058fe66286256f9eec7f9742db
diff --git a/math/factorial_memoization.cpp b/math/factorial_memoization.cpp index c53df6e498d..356c1556083 100644 --- a/math/factorial_memoization.cpp +++ b/math/factorial_memoization.cpp @@ -1,73 +1,65 @@ /** * @file - * @brief [Factorial](https://en.wikipedia.org/wiki/Factorial) calculation using recursion and [m...
[ "math/factorial_memoization.cpp" ]
[]
true
TheAlgorithms/C-Plus-Plus
2,991
issue_to_patch
style: remove unused variable
#### Description of Change <!-- Thank you for your Pull Request. Please provide a description above and review the requirements below. Contributors guide: https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/CONTRIBUTING.md --> `is_path_found` is essentially not used. This PR removes it. #### Checklist...
35b1bcbe442a72a788d53baec2a5d9f707723d8d
866297a2c3bd2c3f9ef7b4f8eb7c5f9c3ee4c4a5
diff --git a/graph/max_flow_with_ford_fulkerson_and_edmond_karp_algo.cpp b/graph/max_flow_with_ford_fulkerson_and_edmond_karp_algo.cpp index 20571cdc518..e81ca38b914 100644 --- a/graph/max_flow_with_ford_fulkerson_and_edmond_karp_algo.cpp +++ b/graph/max_flow_with_ford_fulkerson_and_edmond_karp_algo.cpp @@ -27,8 +27,7 ...
[ "graph/max_flow_with_ford_fulkerson_and_edmond_karp_algo.cpp" ]
[]
true
TheAlgorithms/C-Plus-Plus
2,993
issue_to_patch
doc: fix typo in ccl.h
Fixed "Cicular" -> "Circular" #### Description of Change <!-- Thank you for your Pull Request. Please provide a description above and review the requirements below. Contributors guide: https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/CONTRIBUTING.md --> #### Checklist <!-- Remove items that do not...
651d622775acd28e2afc8c10cb953c356efb9289
49f5ce4a4d969d7d41f2fbd17f4093770ca418b4
diff --git a/data_structures/cll/cll.h b/data_structures/cll/cll.h index a1a9b4d925d..aa89da0114f 100644 --- a/data_structures/cll/cll.h +++ b/data_structures/cll/cll.h @@ -1,5 +1,5 @@ /* - * Simple data structure CLL (Cicular Linear Linked List) + * Simple data structure CLL (Circular Linear Linked List) * */ #inc...
[ "data_structures/cll/cll.h" ]
[]
true
TheAlgorithms/C-Plus-Plus
2,990
issue_to_patch
style: resolve `-Wunused-parameter`
#### Description of Change <!-- Thank you for your Pull Request. Please provide a description above and review the requirements below. Contributors guide: https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/CONTRIBUTING.md --> The aim of this PR is to resolve some of the `-Wunused-parameter` warnings. ...
0bd697db792c41deefa7d534187aea866b3e7e6a
e2b47c611dac78a9016327f8a0c1451f49ee60dd
diff --git a/ciphers/uint128_t.hpp b/ciphers/uint128_t.hpp index 7abffb08a61..634f7c81425 100644 --- a/ciphers/uint128_t.hpp +++ b/ciphers/uint128_t.hpp @@ -350,7 +350,7 @@ class uint128_t { * @brief operator -- (post-decrement) * @returns decremented value of this */ - inline uint128_t operator--(...
[ "ciphers/uint128_t.hpp", "ciphers/uint256_t.hpp" ]
[]
true
TheAlgorithms/C-Plus-Plus
2,987
issue_to_patch
doc: change the versions in the readme to their latest used in the repository
#### Description of Change The compiler versions mentioned in the readme are not accurate and hence needs to be changed. This pr updates the Readme file and changes the versions to the ones seen in the awesome workflow #### Checklist <!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->...
f1ff652601224ba7fdd84e4c905e6b91c825d4ad
ca2aeecf0c4ee742ca40c5a89b899ac29146aa75
diff --git a/README.md b/README.md index 9f32c07b70e..c17b8d5a989 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # The Algorithms - C++ # {#mainpage} + <!-- the suffix in the above line is required for doxygen to consider this as the index page of the generated documentation site --> [![Gitpod Ready-to-Cod...
[ "README.md" ]
[]
true
TheAlgorithms/C-Plus-Plus
2,964
issue_to_patch
feat: Add memoized version of factorial
Description of Change Added `factorial_memoization.cpp` to the math directory, implementing factorial calculation using recursion with memoization (top-down dynamic programming). file location for ref: `math/factorial_memoization.cpp`
4d1aa26af4eb09535333b7d6b63bf5e1759f6d1c
f45559d6e6af0508e93f3fcd9a3549d66520d63f
diff --git a/math/factorial_memoization.cpp b/math/factorial_memoization.cpp new file mode 100644 index 00000000000..c53df6e498d --- /dev/null +++ b/math/factorial_memoization.cpp @@ -0,0 +1,73 @@ +/** + * @file + * @brief [Factorial](https://en.wikipedia.org/wiki/Factorial) calculation using recursion and [memoization...
[ "math/factorial_memoization.cpp" ]
[ { "comment": "```suggestion\n * Space Complexity: O(n)\n * @author [Vedant Mukhedkar](https://github.com/git5v)\n```\n", "path": "dynamic_programming/factorial_top_down_dp.cpp", "hunk": "@@ -0,0 +1,64 @@\n+/**\n+ * @file\n+ * @brief [Factorial calculation using recursion and memoization (dynamic program...
true
TheAlgorithms/C-Plus-Plus
2,964
comment_to_fix
feat: Add memoized version of factorial
Since 128 might not be available in all platforms let's use 64
4d1aa26af4eb09535333b7d6b63bf5e1759f6d1c
f45559d6e6af0508e93f3fcd9a3549d66520d63f
diff --git a/math/factorial_memoization.cpp b/math/factorial_memoization.cpp new file mode 100644 index 00000000000..c53df6e498d --- /dev/null +++ b/math/factorial_memoization.cpp @@ -0,0 +1,73 @@ +/** + * @file + * @brief [Factorial](https://en.wikipedia.org/wiki/Factorial) calculation using recursion and [memoization...
[ "math/factorial_memoization.cpp" ]
[ { "comment": "Since 128 might not be available in all platforms let's use 64", "path": "math/factorial_memoization.cpp", "hunk": "@@ -0,0 +1,61 @@\n+/**\n+ * @file\n+ * @brief [Factorial calculation using recursion and memoization (dynamic programming)](https://en.wikipedia.org/wiki/Factorial)\n+ * @det...
true
TheAlgorithms/C-Plus-Plus
2,964
comment_to_fix
feat: Add memoized version of factorial
```suggestion #include <cassert> // For test cases #include <cstdint> ```
4d1aa26af4eb09535333b7d6b63bf5e1759f6d1c
f45559d6e6af0508e93f3fcd9a3549d66520d63f
diff --git a/math/factorial_memoization.cpp b/math/factorial_memoization.cpp new file mode 100644 index 00000000000..c53df6e498d --- /dev/null +++ b/math/factorial_memoization.cpp @@ -0,0 +1,73 @@ +/** + * @file + * @brief [Factorial](https://en.wikipedia.org/wiki/Factorial) calculation using recursion and [memoization...
[ "math/factorial_memoization.cpp" ]
[ { "comment": "```suggestion\n#include <cassert> // For test cases\n#include <cstdint> \n```\n", "path": "math/factorial_memoization.cpp", "hunk": "@@ -0,0 +1,61 @@\n+/**\n+ * @file\n+ * @brief [Factorial calculation using recursion and memoization (dynamic programming)](https://en.wikipedia.org/wiki/Fa...
true
TheAlgorithms/C-Plus-Plus
2,964
comment_to_fix
feat: Add memoized version of factorial
```suggestion #include <iostream> /// for IO operations /** * @namespace math * @brief Math algorithms */ namespace math { ```
4d1aa26af4eb09535333b7d6b63bf5e1759f6d1c
f45559d6e6af0508e93f3fcd9a3549d66520d63f
diff --git a/math/factorial_memoization.cpp b/math/factorial_memoization.cpp new file mode 100644 index 00000000000..c53df6e498d --- /dev/null +++ b/math/factorial_memoization.cpp @@ -0,0 +1,73 @@ +/** + * @file + * @brief [Factorial](https://en.wikipedia.org/wiki/Factorial) calculation using recursion and [memoization...
[ "math/factorial_memoization.cpp" ]
[ { "comment": "```suggestion\r\n#include <iostream> /// for IO operations\r\n\r\n/**\r\n * @namespace math\r\n * @brief Math algorithms\r\n */\r\nnamespace math {\r\n\r\n```", "path": "math/factorial_memoization.cpp", "hunk": "@@ -0,0 +1,64 @@\n+/**\n+ * @file\n+ * @brief [Factorial calculation using re...
true
TheAlgorithms/C-Plus-Plus
2,964
comment_to_fix
feat: Add memoized version of factorial
```suggestion } // namespace math ```
4d1aa26af4eb09535333b7d6b63bf5e1759f6d1c
f45559d6e6af0508e93f3fcd9a3549d66520d63f
diff --git a/math/factorial_memoization.cpp b/math/factorial_memoization.cpp new file mode 100644 index 00000000000..c53df6e498d --- /dev/null +++ b/math/factorial_memoization.cpp @@ -0,0 +1,73 @@ +/** + * @file + * @brief [Factorial](https://en.wikipedia.org/wiki/Factorial) calculation using recursion and [memoization...
[ "math/factorial_memoization.cpp" ]
[ { "comment": "```suggestion\r\n\r\n} // namespace math\r\n```", "path": "math/factorial_memoization.cpp", "hunk": "@@ -0,0 +1,64 @@\n+/**\n+ * @file\n+ * @brief [Factorial calculation using recursion and memoization (dynamic programming)](https://en.wikipedia.org/wiki/Factorial)\n+ * @details\n+ * This ...
true
TheAlgorithms/C-Plus-Plus
2,964
comment_to_fix
feat: Add memoized version of factorial
```suggestion assert(math::fact_recursion(0) == 1); assert(math::fact_recursion(1) == 1); assert(math::fact_recursion(5) == 120); assert(math::fact_recursion(10) == 3628800); ```
4d1aa26af4eb09535333b7d6b63bf5e1759f6d1c
f45559d6e6af0508e93f3fcd9a3549d66520d63f
diff --git a/math/factorial_memoization.cpp b/math/factorial_memoization.cpp new file mode 100644 index 00000000000..c53df6e498d --- /dev/null +++ b/math/factorial_memoization.cpp @@ -0,0 +1,73 @@ +/** + * @file + * @brief [Factorial](https://en.wikipedia.org/wiki/Factorial) calculation using recursion and [memoization...
[ "math/factorial_memoization.cpp" ]
[ { "comment": "```suggestion\r\n assert(math::fact_recursion(0) == 1);\r\n assert(math::fact_recursion(1) == 1);\r\n assert(math::fact_recursion(5) == 120);\r\n assert(math::fact_recursion(10) == 3628800);\r\n```", "path": "math/factorial_memoization.cpp", "hunk": "@@ -0,0 +1,64 @@\n+/**\n+ *...
true
TheAlgorithms/C-Plus-Plus
2,964
comment_to_fix
feat: Add memoized version of factorial
```suggestion #include <iostream> // for std::cout #include <cassert> // For test cases #include <array> // For std::array #include <cstdint> // For uint64_t ```
4d1aa26af4eb09535333b7d6b63bf5e1759f6d1c
f45559d6e6af0508e93f3fcd9a3549d66520d63f
diff --git a/math/factorial_memoization.cpp b/math/factorial_memoization.cpp new file mode 100644 index 00000000000..c53df6e498d --- /dev/null +++ b/math/factorial_memoization.cpp @@ -0,0 +1,73 @@ +/** + * @file + * @brief [Factorial](https://en.wikipedia.org/wiki/Factorial) calculation using recursion and [memoization...
[ "math/factorial_memoization.cpp" ]
[ { "comment": "```suggestion\r\n#include <iostream> // for std::cout\r\n#include <cassert> // For test cases\r\n#include <array> // For std::array\r\n#include <cstdint> // For uint64_t\r\n```", "path": "math/factorial_memoization.cpp", "hunk": "@@ -0,0 +1,72 @@\n+/**\n+ * @file\n+ * @brief [Factoria...
true
TheAlgorithms/C-Plus-Plus
2,964
comment_to_fix
feat: Add memoized version of factorial
```suggestion ```
4d1aa26af4eb09535333b7d6b63bf5e1759f6d1c
f45559d6e6af0508e93f3fcd9a3549d66520d63f
diff --git a/math/factorial_memoization.cpp b/math/factorial_memoization.cpp new file mode 100644 index 00000000000..c53df6e498d --- /dev/null +++ b/math/factorial_memoization.cpp @@ -0,0 +1,73 @@ +/** + * @file + * @brief [Factorial](https://en.wikipedia.org/wiki/Factorial) calculation using recursion and [memoization...
[ "math/factorial_memoization.cpp" ]
[ { "comment": "```suggestion\r\n```", "path": "math/factorial_memoization.cpp", "hunk": "@@ -0,0 +1,72 @@\n+/**\n+ * @file\n+ * @brief [Factorial calculation using recursion and memoization (dynamic programming)](https://en.wikipedia.org/wiki/Factorial)\n+ * @details\n+ * This program computes the factor...
true
TheAlgorithms/C-Plus-Plus
2,964
comment_to_fix
feat: Add memoized version of factorial
```suggestion * @brief [Factorial](https://en.wikipedia.org/wiki/Factorial) calculation using recursion and [memoization](https://en.wikipedia.org/wiki/Memoization) ```
4d1aa26af4eb09535333b7d6b63bf5e1759f6d1c
f45559d6e6af0508e93f3fcd9a3549d66520d63f
diff --git a/math/factorial_memoization.cpp b/math/factorial_memoization.cpp new file mode 100644 index 00000000000..c53df6e498d --- /dev/null +++ b/math/factorial_memoization.cpp @@ -0,0 +1,73 @@ +/** + * @file + * @brief [Factorial](https://en.wikipedia.org/wiki/Factorial) calculation using recursion and [memoization...
[ "math/factorial_memoization.cpp" ]
[ { "comment": "```suggestion\r\n * @brief [Factorial](https://en.wikipedia.org/wiki/Factorial) calculation using recursion and [memoization](https://en.wikipedia.org/wiki/Memoization) \r\n```", "path": "math/factorial_memoization.cpp", "hunk": "@@ -0,0 +1,71 @@\n+/**\n+ * @file\n+ * @brief [Factorial cal...
true
TheAlgorithms/C-Plus-Plus
2,964
comment_to_fix
feat: Add memoized version of factorial
```suggestion * * Memoization is a form of caching where the result to an expensive function call * is stored and returned. ```
4d1aa26af4eb09535333b7d6b63bf5e1759f6d1c
f45559d6e6af0508e93f3fcd9a3549d66520d63f
diff --git a/math/factorial_memoization.cpp b/math/factorial_memoization.cpp new file mode 100644 index 00000000000..c53df6e498d --- /dev/null +++ b/math/factorial_memoization.cpp @@ -0,0 +1,73 @@ +/** + * @file + * @brief [Factorial](https://en.wikipedia.org/wiki/Factorial) calculation using recursion and [memoization...
[ "math/factorial_memoization.cpp" ]
[ { "comment": "```suggestion\r\n * \r\n * Memoization is a form of caching where the result to an expensive function call\r\n * is stored and returned.\r\n```", "path": "math/factorial_memoization.cpp", "hunk": "@@ -0,0 +1,71 @@\n+/**\n+ * @file\n+ * @brief [Factorial calculation using recursion and memo...
true
TheAlgorithms/C-Plus-Plus
2,985
issue_to_patch
ci: add pull_request write permission to linter
#### Description of Change The awesome workflow linter currently lints the file and does not push changes because of the lack of permissions, With this pr I hope to fix this issue. #### Checklist <!-- Remove items that do not apply. For completed items, change [ ] to [x]. --> - [x] Added description of change - ...
c39d84b50b988d10a5fe5f5ca5e480124ce180e5
d1eaab62318c1c6e2094452975d513840942313d
diff --git a/.github/workflows/awesome_workflow.yml b/.github/workflows/awesome_workflow.yml index 70dd717fa33..473d7940663 100644 --- a/.github/workflows/awesome_workflow.yml +++ b/.github/workflows/awesome_workflow.yml @@ -1,6 +1,7 @@ name: Awesome CI Workflow on: [push, pull_request] permissions: + pull-requests...
[ ".github/workflows/awesome_workflow.yml" ]
[]
true
TheAlgorithms/C-Plus-Plus
2,982
issue_to_patch
Added constexpr GRAVITY constant (9.80665) as per guidelines
#### Description of Change <!-- Added constexpr double GRAVITY = 9.80665; as a standard gravity constant in physics algorithms to replace hardcoded values. This improves code readability, consistency, and follows international standards. --> #### Checklist - [x] Added description of change - [x] Added tests a...
c917fc456028eb692ede9c098a9650900081fcb0
73bb25b4fd4b83960b47f16434485b96b0b56cb6
diff --git a/physics/ground_to_ground_projectile_motion.cpp b/physics/ground_to_ground_projectile_motion.cpp index af362c524a4..268557db274 100644 --- a/physics/ground_to_ground_projectile_motion.cpp +++ b/physics/ground_to_ground_projectile_motion.cpp @@ -18,6 +18,11 @@ * @namespace physics * @brief Physics algor...
[ "physics/ground_to_ground_projectile_motion.cpp" ]
[ { "comment": "```suggestion\nconstexpr double GRAVITY = 9.80665; ///< Standard gravity (m/s^2)\r\n```\n", "path": "physics/ground_to_ground_projectile_motion.cpp", "hunk": "@@ -18,6 +18,11 @@\n * @namespace physics\r\n * @brief Physics algorithms\r\n */\r\n+\r\n+// Define gravity as a constant within...
true
TheAlgorithms/C-Plus-Plus
2,982
comment_to_fix
Added constexpr GRAVITY constant (9.80665) as per guidelines
```suggestion constexpr double GRAVITY = 9.80665; ///< Standard gravity (m/s^2) ```
c917fc456028eb692ede9c098a9650900081fcb0
73bb25b4fd4b83960b47f16434485b96b0b56cb6
diff --git a/physics/ground_to_ground_projectile_motion.cpp b/physics/ground_to_ground_projectile_motion.cpp index af362c524a4..268557db274 100644 --- a/physics/ground_to_ground_projectile_motion.cpp +++ b/physics/ground_to_ground_projectile_motion.cpp @@ -18,6 +18,11 @@ * @namespace physics * @brief Physics algor...
[ "physics/ground_to_ground_projectile_motion.cpp" ]
[ { "comment": "```suggestion\nconstexpr double GRAVITY = 9.80665; ///< Standard gravity (m/s^2)\r\n```\n", "path": "physics/ground_to_ground_projectile_motion.cpp", "hunk": "@@ -18,6 +18,11 @@\n * @namespace physics\r\n * @brief Physics algorithms\r\n */\r\n+\r\n+// Define gravity as a constant within...
true
TheAlgorithms/C-Plus-Plus
2,984
issue_to_patch
fix: initialise `key` to avoid undefined behaviour
#### Description of Change <!-- Thank you for your Pull Request. Please provide a description above and review the requirements below. Contributors guide: https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/CONTRIBUTING.md --> `key` has to be initialized before readings its value in the `while` loop belo...
b30bdd30bfd7029a54e3893230cd953d14357ae6
1c93a967a4553e8a5921fd93acceb62dad50aa21
diff --git a/search/hash_search.cpp b/search/hash_search.cpp index 6e4caffc30e..5643520aadb 100644 --- a/search/hash_search.cpp +++ b/search/hash_search.cpp @@ -98,7 +98,7 @@ int hash_search(int key, int* counter) { // Hash lookup function /** main function */ int main() { link p; - int key, index, i, counte...
[ "search/hash_search.cpp" ]
[ { "comment": "Was the key supposed to be -1 the loop checks whether the key is -1 a couple of lines below this. This looks fine but do you think it should be -1? \n\n", "path": "search/hash_search.cpp", "hunk": "@@ -98,7 +98,7 @@ int hash_search(int key, int* counter) { // Hash lookup function\n /** ma...
true
TheAlgorithms/C-Plus-Plus
2,984
comment_to_fix
fix: initialise `key` to avoid undefined behaviour
Was the key supposed to be -1 the loop checks whether the key is -1 a couple of lines below this. This looks fine but do you think it should be -1?
b30bdd30bfd7029a54e3893230cd953d14357ae6
1c93a967a4553e8a5921fd93acceb62dad50aa21
diff --git a/search/hash_search.cpp b/search/hash_search.cpp index 6e4caffc30e..5643520aadb 100644 --- a/search/hash_search.cpp +++ b/search/hash_search.cpp @@ -98,7 +98,7 @@ int hash_search(int key, int* counter) { // Hash lookup function /** main function */ int main() { link p; - int key, index, i, counte...
[ "search/hash_search.cpp" ]
[ { "comment": "Was the key supposed to be -1 the loop checks whether the key is -1 a couple of lines below this. This looks fine but do you think it should be -1? \n\n", "path": "search/hash_search.cpp", "hunk": "@@ -98,7 +98,7 @@ int hash_search(int key, int* counter) { // Hash lookup function\n /** ma...
true