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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
BookStackApp/BookStack | 5,731 | issue_to_patch | New WYSIWYG editor changes for July 2025 | Related to #5631
### Changes
- Fixed text highlight action & updated label.
- Fixed unstable table cell background colors.
- Fixed incorrect header levels used via format shortcuts.
- Fixed UI menu not reflecting block format changes.
- Fixed URLs not allowing any protocol as per old editor.
- Updated source... | 0a73b70b64e1b4852a43b461cf21fdcdb1fb3346 | d145efb6f6eac73947c7f3c53173f42b4dd9a615 | diff --git a/lang/en/editor.php b/lang/en/editor.php
index 752c6f3f702..0d250e9a7bd 100644
--- a/lang/en/editor.php
+++ b/lang/en/editor.php
@@ -48,6 +48,7 @@
'superscript' => 'Superscript',
'subscript' => 'Subscript',
'text_color' => 'Text color',
+ 'highlight_color' => 'Highlight color',
'custo... | [
"lang/en/editor.php",
"resources/js/wysiwyg/index.ts",
"resources/js/wysiwyg/lexical/core/__tests__/utils/index.ts",
"resources/js/wysiwyg/lexical/html/__tests__/unit/LexicalHtml.test.ts",
"resources/js/wysiwyg/lexical/html/index.ts",
"resources/js/wysiwyg/lexical/link/__tests__/unit/LexicalAutoLinkNode.t... | [] | diff --git a/resources/js/wysiwyg/lexical/core/__tests__/utils/index.ts b/resources/js/wysiwyg/lexical/core/__tests__/utils/index.ts
index e18ef97560b..fd87877eefb 100644
--- a/resources/js/wysiwyg/lexical/core/__tests__/utils/index.ts
+++ b/resources/js/wysiwyg/lexical/core/__tests__/utils/index.ts
@@ -848,4 +848,20 @... | true | |
BookStackApp/BookStack | 5,782 | issue_to_patch | Laravel 12 & dependancy upgrades |
### Doc Updates:
- Update Notes:
- The `APP_NAME` env option is now not used for the cache key. This option was never documented at all, but if used to prevent cache collisions please use the `CACHE_PREFIX` option instead. | d6296ac7a5f7133abf4ddaa3c46ecf99d92416ae | a27ce6e9154387ac24ad3d3df3321ddb19dd7592 | diff --git a/app/Config/cache.php b/app/Config/cache.php
index 9a0be8eabfc..01c822a653b 100644
--- a/app/Config/cache.php
+++ b/app/Config/cache.php
@@ -85,6 +85,6 @@
|
*/
- 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache_'),
+ 'prefix' => env('CACHE_PREFIX', 'book... | [
"app/Config/cache.php",
"app/Config/database.php",
"composer.json",
"composer.lock",
"package-lock.json",
"package.json",
"resources/js/wysiwyg/lexical/core/LexicalSelection.ts",
"resources/js/wysiwyg/lexical/core/__tests__/unit/LexicalEditor.test.ts",
"resources/js/wysiwyg/lexical/core/__tests__/un... | [] | diff --git a/resources/js/wysiwyg/lexical/core/__tests__/unit/LexicalEditor.test.ts b/resources/js/wysiwyg/lexical/core/__tests__/unit/LexicalEditor.test.ts
index a54d33ca4a4..f195974d049 100644
--- a/resources/js/wysiwyg/lexical/core/__tests__/unit/LexicalEditor.test.ts
+++ b/resources/js/wysiwyg/lexical/core/__tests_... | true | |
BookStackApp/BookStack | 5,917 | issue_to_patch | Internal reference handling on content copying | For #3239
### Remaining Todo
- [x] Implement core reference change logic
- [x] Manual testing to double check implementation | 0f40aeb0d31cae2f7b27ec7e7a9e6ad7562341eb | 3cd3e73f607dc7513c1bd7dc9d458808267eae4c | diff --git a/app/Entities/Models/Page.php b/app/Entities/Models/Page.php
index 88c59bd1bd0..a1d3fc7b40d 100644
--- a/app/Entities/Models/Page.php
+++ b/app/Entities/Models/Page.php
@@ -124,6 +124,14 @@ public function getUrl(string $path = ''): string
return url('/' . implode('/', $parts));
}
+ /**
+... | [
"app/Entities/Models/Page.php",
"app/Entities/Tools/Cloner.php",
"app/References/ReferenceChangeContext.php",
"app/References/ReferenceUpdater.php",
"tests/Entity/BookTest.php",
"tests/Entity/ChapterTest.php",
"tests/Entity/CopyTest.php",
"tests/Entity/PageTest.php"
] | [] | diff --git a/tests/Entity/BookTest.php b/tests/Entity/BookTest.php
index 545d6b30578..a7142f03736 100644
--- a/tests/Entity/BookTest.php
+++ b/tests/Entity/BookTest.php
@@ -264,108 +264,4 @@ public function test_show_view_displays_description_if_no_description_html_set()
$resp = $this->asEditor()->get($book->g... | true | |
BookStackApp/BookStack | 5,913 | issue_to_patch | Slug History Tracking & Usage | Adds a purpose-built slug tracking system to note old slugs on changes, so that they can be used for lookup.
We're already doing something similar via page revisions, but this will be a more robust implementation which works for all core content types.
For #5411
### Todo
- [x] Create new table & migrate revis... | ad582ab9f8eb6354f7da8930ddb3f455e5279319 | cdd164e3e3e0fb1bcd40329043503b1bea849cab | diff --git a/app/App/SluggableInterface.php b/app/App/SluggableInterface.php
index 96af49cd323..dd544f5ed21 100644
--- a/app/App/SluggableInterface.php
+++ b/app/App/SluggableInterface.php
@@ -5,11 +5,9 @@
/**
* Assigned to models that can have slugs.
* Must have the below properties.
+ *
+ * @property string $slu... | [
"app/App/SluggableInterface.php",
"app/Entities/Controllers/BookController.php",
"app/Entities/Controllers/BookshelfController.php",
"app/Entities/Controllers/ChapterController.php",
"app/Entities/Controllers/PageController.php",
"app/Entities/Models/BookChild.php",
"app/Entities/Models/Entity.php",
"... | [] | diff --git a/tests/Entity/BookTest.php b/tests/Entity/BookTest.php
index 543c4e8bbdb..545d6b30578 100644
--- a/tests/Entity/BookTest.php
+++ b/tests/Entity/BookTest.php
@@ -238,30 +238,6 @@ public function test_books_view_shows_view_toggle_option()
$this->assertEquals('list', setting()->getUser($editor, 'books... | true | |
BookStackApp/BookStack | 5,909 | issue_to_patch | Images: Updated access to consider public secure_restricted | Had prevented public access for images when secure_restricted images was enabled (and for just secure images) when app settings allowed public access.
This considers the app public setting, and adds tests to cover extra scenarios to prevent regression.
Related to #5906 | 47f12cc8f6830a8e20b3c3d8efad40d7c689a217 | 9934f85ba93a9450b2a7a02559e658c5181aca61 | diff --git a/app/Uploads/ImageService.php b/app/Uploads/ImageService.php
index a26a04ac5c6..ed640913ec3 100644
--- a/app/Uploads/ImageService.php
+++ b/app/Uploads/ImageService.php
@@ -264,7 +264,7 @@ public function pathAccessible(string $imagePath): bool
return false;
}
- if ($this->sto... | [
"app/Uploads/ImageService.php",
"app/Uploads/ImageStorage.php",
"composer.lock",
"tests/Uploads/ImageTest.php"
] | [] | diff --git a/tests/Uploads/ImageTest.php b/tests/Uploads/ImageTest.php
index c5a5eb2ba0f..f36be87023d 100644
--- a/tests/Uploads/ImageTest.php
+++ b/tests/Uploads/ImageTest.php
@@ -5,6 +5,8 @@
use BookStack\Entities\Repos\PageRepo;
use BookStack\Uploads\Image;
use BookStack\Uploads\ImageService;
+use BookStack\Uploa... | true | |
BookStackApp/BookStack | 5,887 | issue_to_patch | Updated translations with latest Crowdin changes | 8ab9252f9bd1626b87df044b14ce3469b1ca07bf | 4706ebc57943027e459571ebf5ce7f2a0c1b677e | diff --git a/lang/sq/common.php b/lang/sq/common.php
index 06a9e855ce3..aa2988124e4 100644
--- a/lang/sq/common.php
+++ b/lang/sq/common.php
@@ -89,8 +89,8 @@
'homepage' => 'Homepage',
'header_menu_expand' => 'Expand Header Menu',
'profile_menu' => 'Profile Menu',
- 'view_profile' => 'View Profile',
-... | [
"lang/sq/common.php"
] | [] | true | |||
BookStackApp/BookStack | 5,899 | issue_to_patch | Exports: Updated perm checking for images in ZIP exports | For #5885
Adds to, uses and cleans-up central permission checking in ImageService to mirror that which would be experienced by users in the UI to result in the same image access conditions.
Adds testing to cover. | 8ab9252f9bd1626b87df044b14ce3469b1ca07bf | aaa28186bc0dff12c38f4627dac2034fa9ddb63d | diff --git a/app/Exports/ZipExports/ZipExportReferences.php b/app/Exports/ZipExports/ZipExportReferences.php
index 64107cf21aa..a79988d44fe 100644
--- a/app/Exports/ZipExports/ZipExportReferences.php
+++ b/app/Exports/ZipExports/ZipExportReferences.php
@@ -15,6 +15,7 @@
use BookStack\Permissions\Permission;
use BookS... | [
"app/Exports/ZipExports/ZipExportReferences.php",
"app/Uploads/Image.php",
"app/Uploads/ImageService.php",
"app/Uploads/ImageStorage.php",
"tests/Exports/ZipExportTest.php"
] | [] | diff --git a/tests/Exports/ZipExportTest.php b/tests/Exports/ZipExportTest.php
index 692a5910f3c..063f6d9425a 100644
--- a/tests/Exports/ZipExportTest.php
+++ b/tests/Exports/ZipExportTest.php
@@ -374,6 +374,54 @@ public function test_image_links_are_handled_when_using_external_storage_url()
$this->assertStrin... | true | |
BookStackApp/BookStack | 5,584 | issue_to_patch | Content Comments | Related to #1265
## Todo
- [x] Inline comment display
- [ ] ~~Option for controlling display~~
- Omitting this for initial implementation as we'll gather some feedback about best placement and control level.
- [x] Selection zone representation (on focus/click?)
- [x] Indicator for if the comment is ... | fa566f156ad8998d67a63be2856dafc7ce277d88 | 32b29fcdfc9e54416d5c01cf54b8a9df6753d326 | diff --git a/app/Activity/CommentRepo.php b/app/Activity/CommentRepo.php
index 3336e17e988..7005f8fcf83 100644
--- a/app/Activity/CommentRepo.php
+++ b/app/Activity/CommentRepo.php
@@ -4,6 +4,8 @@
use BookStack\Activity\Models\Comment;
use BookStack\Entities\Models\Entity;
+use BookStack\Exceptions\NotifyException;... | [
"app/Activity/CommentRepo.php",
"app/Activity/Controllers/CommentController.php",
"app/Activity/Models/Comment.php",
"app/Activity/Tools/CommentTree.php",
"app/Activity/Tools/CommentTreeNode.php",
"database/factories/Activity/Models/CommentFactory.php",
"database/migrations/2025_04_18_215145_add_content... | [] | diff --git a/resources/js/services/__tests__/translations.test.ts b/resources/js/services/__tests__/translations.test.ts
index 043f1745ff6..5014051ab04 100644
--- a/resources/js/services/__tests__/translations.test.ts
+++ b/resources/js/services/__tests__/translations.test.ts
@@ -58,6 +58,11 @@ describe('Translations S... | true | |
BookStackApp/BookStack | 5,843 | issue_to_patch | Updated translations with latest Crowdin changes | 4c7d6420ee6ab08c5d1df5221962d84abcb89b21 | d7335f091d3907232137afc3456386d5caab0e0e | diff --git a/lang/de/entities.php b/lang/de/entities.php
index 2cfdd1490ed..94c327b7e06 100644
--- a/lang/de/entities.php
+++ b/lang/de/entities.php
@@ -65,7 +65,7 @@
'import_errors_desc' => 'Die folgenden Fehler sind während des Importversuchs aufgetreten:',
'breadcrumb_siblings_for_page' => 'Navigate siblin... | [
"lang/de/entities.php",
"lang/de_informal/entities.php",
"lang/es_AR/entities.php",
"lang/fa/editor.php",
"lang/fa/entities.php",
"lang/fr/activities.php",
"lang/fr/editor.php",
"lang/zh_CN/entities.php"
] | [] | true | |||
BookStackApp/BookStack | 5,860 | issue_to_patch | API: Added endpoints for reading image data | For #5519
### Todo
- [x] Check all tests are passing
- [x] Run some manual tests | 652124abaf8888339190bf2cbfd74c225ae28421 | 02d024aa322e4cd7ef127e1c45940ba122e34eea | diff --git a/app/Config/filesystems.php b/app/Config/filesystems.php
index ab73fec2968..facf5f2df2f 100644
--- a/app/Config/filesystems.php
+++ b/app/Config/filesystems.php
@@ -11,7 +11,7 @@
return [
// Default Filesystem Disk
- // Options: local, local_secure, s3
+ // Options: local, local_secure, local_... | [
"app/Config/filesystems.php",
"app/Uploads/Controllers/ImageGalleryApiController.php",
"app/Uploads/Image.php",
"app/Uploads/ImageService.php",
"dev/api/requests/image-gallery-readDataForUrl.http",
"routes/api.php",
"tests/Api/ImageGalleryApiTest.php"
] | [] | diff --git a/tests/Api/ImageGalleryApiTest.php b/tests/Api/ImageGalleryApiTest.php
index 6670931074e..07c20c83416 100644
--- a/tests/Api/ImageGalleryApiTest.php
+++ b/tests/Api/ImageGalleryApiTest.php
@@ -275,6 +275,69 @@ public function test_read_endpoint_does_not_show_if_no_permissions_for_related_p
$resp->a... | true | |
BookStackApp/BookStack | 5,854 | issue_to_patch | Pagable and efficient search | This PR aims to change how searches are done, to use a single core query instead of a query per entity type.
This should make the search more efficient, while resulting in a stable & consistent response item count.
### Todo
- [x] Debug large response processing time gap between making the queries, and rendering ... | c21c36e2a6668f0d1764598f37fb3524b0091609 | 751934c84a3e4c0482ca8086997c485ee6d6f077 | diff --git a/app/Entities/Models/Entity.php b/app/Entities/Models/Entity.php
index 77393cbbc4e..b47a029ece8 100644
--- a/app/Entities/Models/Entity.php
+++ b/app/Entities/Models/Entity.php
@@ -471,4 +471,17 @@ protected function getContentsAttributes(): array
return $contentFields;
}
+
+ /**
+ * ... | [
"app/Entities/Models/Entity.php",
"app/Entities/Models/EntityTable.php",
"app/Entities/Queries/EntityQueries.php",
"app/Entities/Tools/EntityHydrator.php",
"app/Entities/Tools/MixedEntityListLoader.php",
"app/Search/SearchApiController.php",
"app/Search/SearchController.php",
"app/Search/SearchRunner.... | [] | diff --git a/tests/Api/SearchApiTest.php b/tests/Api/SearchApiTest.php
index 9da7900ca9a..517c5d8e4ef 100644
--- a/tests/Api/SearchApiTest.php
+++ b/tests/Api/SearchApiTest.php
@@ -113,6 +113,7 @@ public function test_all_endpoint_includes_parent_details_where_visible()
$this->permissions->disableEntityInherit... | true | |
BookStackApp/BookStack | 5,844 | issue_to_patch | Updated handling of deleted user ID handling in DB | Updated uses of user ID to nullify on delete.
Added testing to cover deletion of user relations.
Added model factories to support changes and potential other tests.
Cleans existing ID references in the DB via migration.
Aligns with entity changes to get the database in a cleaner & more consistent state. | 4c7d6420ee6ab08c5d1df5221962d84abcb89b21 | efff8700d47f83ab9c4c83b27143d9a27dc69c9a | diff --git a/app/Access/Mfa/MfaValue.php b/app/Access/Mfa/MfaValue.php
index 64d20eb18f6..dd3e04618f7 100644
--- a/app/Access/Mfa/MfaValue.php
+++ b/app/Access/Mfa/MfaValue.php
@@ -4,6 +4,7 @@
use BookStack\Users\Models\User;
use Carbon\Carbon;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate... | [
"app/Access/Mfa/MfaValue.php",
"app/Access/SocialAccount.php",
"app/Activity/Models/Activity.php",
"app/Activity/Models/Favourite.php",
"app/Activity/Models/Watch.php",
"app/Entities/Models/Deletion.php",
"app/Entities/Models/PageRevision.php",
"app/Users/Models/User.php",
"app/Users/UserRepo.php",
... | [] | diff --git a/tests/Activity/AuditLogTest.php b/tests/Activity/AuditLogTest.php
index 6b435544df7..a6ba6be9f62 100644
--- a/tests/Activity/AuditLogTest.php
+++ b/tests/Activity/AuditLogTest.php
@@ -83,6 +83,22 @@ public function test_shows_activity_for_deleted_users()
$resp->assertSeeText("[ID: {$viewer->id}] D... | true | |
BookStackApp/BookStack | 5,800 | issue_to_patch | Big scary entity table change | This PR aims to merge the core entity types (books, chapters, pages, shelves) into one core table, with sub-tables for added data.
This moves things into three new tables:
- `entities` - All items, containing most shared metadata.
- `entity_container_data` - The added data for container (non-page) items.
- `ent... | 08dfff05f4dd00bd155cc68990b997544d713373 | b67110d33273b2ae691e55c022f424c3c8234f0e | diff --git a/app/Access/Mfa/MfaSession.php b/app/Access/Mfa/MfaSession.php
index 09b9e53b8ae..b1285341257 100644
--- a/app/Access/Mfa/MfaSession.php
+++ b/app/Access/Mfa/MfaSession.php
@@ -11,7 +11,6 @@ class MfaSession
*/
public function isRequiredForUser(User $user): bool
{
- // TODO - Test bot... | [
"app/Access/Mfa/MfaSession.php",
"app/Console/Commands/UpdateUrlCommand.php",
"app/Entities/Controllers/BookApiController.php",
"app/Entities/Controllers/BookshelfApiController.php",
"app/Entities/Controllers/BookshelfController.php",
"app/Entities/Controllers/ChapterApiController.php",
"app/Entities/Co... | [] | diff --git a/tests/Api/ApiAuthTest.php b/tests/Api/ApiAuthTest.php
index 93e4b02e423..4e446bf5d1a 100644
--- a/tests/Api/ApiAuthTest.php
+++ b/tests/Api/ApiAuthTest.php
@@ -12,7 +12,7 @@ class ApiAuthTest extends TestCase
{
use TestsApi;
- protected $endpoint = '/api/books';
+ protected string $endpoint =... | true | |
BurntSushi/ripgrep | 3,420 | issue_to_patch | Nondeterminism in ignore::WalkBuilder parallel multi-root walk
### Please tick this box to confirm you have reviewed the above.
- [x] I have a different issue.
### What version of ripgrep are you using?
14.1.1
### How did you install ripgrep?
Cargo
### What operating system are you using ripgrep on?
macOS 26.5
... | ignore: scope compiled parent matchers by root | Fixes #3419.
| 48a6ad93f152dc848f1883ceb3bf2c7baab6738c | b6722c177f85a01ed2304781118651c058df3286 | diff --git a/crates/ignore/src/dir.rs b/crates/ignore/src/dir.rs
index 5939f32e84..ef1e3ef78e 100644
--- a/crates/ignore/src/dir.rs
+++ b/crates/ignore/src/dir.rs
@@ -91,7 +91,15 @@ struct IgnoreOptions {
/// Ignore is a matcher useful for recursively walking one or more directories.
#[derive(Clone, Debug)]
-pub(cr... | [
"crates/ignore/src/dir.rs"
] | [
{
"comment": "I'm not very familiar with this code base, but this makes me wonder if it's still worth caching here. \n\nfor `roots: /tmp/project/src, /tmp/project/tests`:\n\n* Before: The entry for `/tmp/project` was shared\n* After: Each root uses its own pre-built `Ignore`, making the caching here useless exc... | true | |
BurntSushi/ripgrep | 3,431 | issue_to_patch | Provide Statically Compiled Binaries for (aarch64|arm64) Linux
Hi, the current releases for arm64 Linux is based on gnu and not musl.
As a result, the binary is dynamically linked:
```bash
$ https://github.com/BurntSushi/ripgrep/releases/download/14.1.0/ripgrep-14.1.0-aarch64-unknown-linux-gnu.tar.gz
$ file rg && ... | ci: add support for `aarch64-unknown-linux-musl` | This includes running tests and binary artifacts.
Fixes #2739
| 4857d6fa67db69a95cd4b6f2adda5d807d4d0119 | d913049ba8f7aa3208be9c165c8c0776c2f1dcde | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 47d33a4a7b..2095280421 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -75,6 +75,10 @@ jobs:
os: ubuntu-latest
rust: stable
target: aarch64-unknown-linux-gnu
+ - build: stable-aarch64-m... | [
".github/workflows/ci.yml",
".github/workflows/release.yml"
] | [] | true | |
BurntSushi/ripgrep | 3,433 | issue_to_patch | docs: update GUIDE to use `lexopt` | ... we migrated off of `clap` long ago.
| 4857d6fa67db69a95cd4b6f2adda5d807d4d0119 | 2afad21d03178a80e2a7df874854d9baadac0a35 | diff --git a/GUIDE.md b/GUIDE.md
index 5f1378839..ca951123a 100644
--- a/GUIDE.md
+++ b/GUIDE.md
@@ -269,24 +269,23 @@ patterns while the next section covers file type filtering.
In our ripgrep source code (see [Basics](#basics) for instructions on how to
get a source archive to search), let's say we wanted to see ... | [
"GUIDE.md"
] | [] | true | ||
BurntSushi/ripgrep | 3,418 | issue_to_patch | docs: s/our projects/this project in AI policy | This was an artifact of using uv's policy. I thought I had changed most
of these but didn't catch this one.
| f0cec341ab95c25c691ad3d5754d4bd9eedde21f | dc1bfa280a4189acb83b38d16060650299527db1 | diff --git a/AI_POLICY.md b/AI_POLICY.md
index e0ddbaaea..667026958 100644
--- a/AI_POLICY.md
+++ b/AI_POLICY.md
@@ -17,9 +17,9 @@ proposed changes in your own words. This includes the pull request body and
responses to questions. **Do not copy responses from the AI when replying to
questions from maintainers.**
-T... | [
"AI_POLICY.md"
] | [] | true | ||
BurntSushi/ripgrep | 3,416 | issue_to_patch | docs: add AI policy for contributors | I've shamlessly adapted this from [uv's AI policy].
[uv's AI policy]: https://github.com/astral-sh/.github/blob/c5187e200db51bfe11d56e13053d29bd3793fdd8/AI_POLICY.md
| 4519153e5e461527f4bca45b042fff45c4ec6fb9 | 543c11321b2eeb0db63acb37d1f9d993559d20bc | diff --git a/AI_POLICY.md b/AI_POLICY.md
new file mode 100644
index 0000000000..e0ddbaaea0
--- /dev/null
+++ b/AI_POLICY.md
@@ -0,0 +1,38 @@
+# AI Policy
+
+Using AI (i.e., LLMs) as tools for coding is welcome. A high bar is held for
+all contributions to this project. Moreover, the project maintainers remain
+responsi... | [
"AI_POLICY.md",
"CONTRIBUTING.md"
] | [] | true | ||
BurntSushi/ripgrep | 2,263 | issue_to_patch | Extend `php` and markdown default types | 5e975c43f883f95e82fead3c663dadf70fe7b2ae | 3023e722e314194964cc25a1615b6395b1808533 | diff --git a/crates/ignore/src/default_types.rs b/crates/ignore/src/default_types.rs
index 84ad7f6342..f006f5185a 100644
--- a/crates/ignore/src/default_types.rs
+++ b/crates/ignore/src/default_types.rs
@@ -146,9 +146,9 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[
]),
("mako", &["*.mako", "*.mao"]),
... | [
"crates/ignore/src/default_types.rs"
] | [
{
"comment": "What about `*.php6`?",
"path": "crates/ignore/src/default_types.rs",
"hunk": "@@ -167,7 +167,10 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[\n (\"pascal\", &[\"*.pas\", \"*.dpr\", \"*.lpr\", \"*.pp\", \"*.inc\"]),\n (\"pdf\", &[\"*.pdf\"]),\n (\"perl\", &[\"*.perl\", \"*... | true | |||
BurntSushi/ripgrep | 2,263 | comment_to_fix | Extend `php` and markdown default types | What about `*.php6`? | 5e975c43f883f95e82fead3c663dadf70fe7b2ae | 3023e722e314194964cc25a1615b6395b1808533 | diff --git a/crates/ignore/src/default_types.rs b/crates/ignore/src/default_types.rs
index 84ad7f6342..f006f5185a 100644
--- a/crates/ignore/src/default_types.rs
+++ b/crates/ignore/src/default_types.rs
@@ -146,9 +146,9 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[
]),
("mako", &["*.mako", "*.mao"]),
... | [
"crates/ignore/src/default_types.rs"
] | [
{
"comment": "What about `*.php6`?",
"path": "crates/ignore/src/default_types.rs",
"hunk": "@@ -167,7 +167,10 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[\n (\"pascal\", &[\"*.pas\", \"*.dpr\", \"*.lpr\", \"*.pp\", \"*.inc\"]),\n (\"pdf\", &[\"*.pdf\"]),\n (\"perl\", &[\"*.perl\", \"*... | true | ||
BurntSushi/ripgrep | 2,263 | comment_to_fix | Extend `php` and markdown default types | I don't think I've ever seen `pht` used for PHP before. Can you show me a project that uses it? | 5e975c43f883f95e82fead3c663dadf70fe7b2ae | 3023e722e314194964cc25a1615b6395b1808533 | diff --git a/crates/ignore/src/default_types.rs b/crates/ignore/src/default_types.rs
index 84ad7f6342..f006f5185a 100644
--- a/crates/ignore/src/default_types.rs
+++ b/crates/ignore/src/default_types.rs
@@ -146,9 +146,9 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[
]),
("mako", &["*.mako", "*.mao"]),
... | [
"crates/ignore/src/default_types.rs"
] | [
{
"comment": "I don't think I've ever seen `pht` used for PHP before. Can you show me a project that uses it?",
"path": "crates/ignore/src/default_types.rs",
"hunk": "@@ -167,7 +167,10 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[\n (\"pascal\", &[\"*.pas\", \"*.dpr\", \"*.lpr\", \"*.pp\", \"*... | true | ||
BurntSushi/ripgrep | 2,263 | comment_to_fix | Extend `php` and markdown default types | ```suggestion
// note that PHP 6 doesn't exist
// See: https://wiki.php.net/rfc/php6
``` | 5e975c43f883f95e82fead3c663dadf70fe7b2ae | 3023e722e314194964cc25a1615b6395b1808533 | diff --git a/crates/ignore/src/default_types.rs b/crates/ignore/src/default_types.rs
index 84ad7f6342..f006f5185a 100644
--- a/crates/ignore/src/default_types.rs
+++ b/crates/ignore/src/default_types.rs
@@ -146,9 +146,9 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[
]),
("mako", &["*.mako", "*.mao"]),
... | [
"crates/ignore/src/default_types.rs"
] | [
{
"comment": "```suggestion\r\n // note that PHP 6 doesn't exist\r\n // See: https://wiki.php.net/rfc/php6\r\n```",
"path": "crates/ignore/src/default_types.rs",
"hunk": "@@ -167,7 +167,11 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[\n (\"pascal\", &[\"*.pas\", \"*.dpr\", \"*.lp... | true | ||
BurntSushi/ripgrep | 3,279 | issue_to_patch | docs: clarify half-boundary syntax for the -w/--word-regexp flag | In [regex 1.10.0](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md#1100-2023-10-09), the `\b{start-half}` and `\b{end-half}` assertions were introduced to improve how the `-w`/`--word-regexp` flag handles patterns containing non-word characters. While ripgrep's CLI help text was updated to mention this synta... | cb66736f146f093497f4dc537b33d0826f9af33c | 3fc9f4134bb95364f8748610d69f27dfa3ca472b | diff --git a/GUIDE.md b/GUIDE.md
index 6d51e460ef..5f1378839c 100644
--- a/GUIDE.md
+++ b/GUIDE.md
@@ -1004,7 +1004,11 @@ used options that will likely impact how you use ripgrep on a regular basis.
as a literal string.
* `-w/--word-regexp`: Require that all matches of the pattern be surrounded
by word boundari... | [
"GUIDE.md",
"crates/core/flags/defs.rs"
] | [] | true | ||
BurntSushi/ripgrep | 3,278 | issue_to_patch | core: bleat a DEBUG message when RIPGREP_CONFIG_PATH is not set | It seems to be common that folks either don't understand how to set
environment variables in a way that propagates to subprocesses, or just
forget to include `export` and think ripgrep is somehow broken.
While `RIPGREP_CONFIG_PATH` not being set is not an error, it still
seems useful to log a debug message when it isn... | 9b84e154c8e404f4c40f6f4e4c674ea02e77324a | aa09897f8a6a05856d90595dae5f8cadf63e9df2 | diff --git a/crates/core/flags/config.rs b/crates/core/flags/config.rs
index 313244f5da..c49716e60a 100644
--- a/crates/core/flags/config.rs
+++ b/crates/core/flags/config.rs
@@ -15,7 +15,13 @@ use bstr::{ByteSlice, io::BufReadExt};
/// Return a sequence of arguments derived from ripgrep rc configuration files.
pub f... | [
"crates/core/flags/config.rs"
] | [] | true | ||
BurntSushi/ripgrep | 3,271 | issue_to_patch | ignore/types: add Containerfile | This PR adds `Containerfile` as a synonym to `Dockerfile`.
`Containerfile` is the preferred file name in [Podman](https://docs.podman.io/en/latest/markdown/podman-build.1.html#file-f-containerfile) and [Buildah](https://github.com/containers/buildah/blob/main/docs/buildah-build.1.md).
In hindsight, `docker` could... | 0a88cccd5188074de96f54a4b6b44a63971ac157 | a50ddc7ce17f98b9624e7a663bb080dd8580427a | diff --git a/crates/ignore/src/default_types.rs b/crates/ignore/src/default_types.rs
index de639783e3..f3c2955920 100644
--- a/crates/ignore/src/default_types.rs
+++ b/crates/ignore/src/default_types.rs
@@ -47,6 +47,7 @@ pub(crate) const DEFAULT_TYPES: &[(&[&str], &[&str])] = &[
(&["cml"], &["*.cml"]),
(&["co... | [
"crates/ignore/src/default_types.rs"
] | [] | true | ||
BurntSushi/ripgrep | 3,165 | issue_to_patch | Add RISC-V (riscv64gc-unknown-linux-gnu) CI and release artifacts | **This PR adds official riscv64 Linux release artifacts so RISC-V developers can run ripgrep natively without cross-compiling.**
## Context & Purpose
**Why**: ripgrep ships binaries for many platforms but not riscv64. Adding a riscv64 GNU artifact gives day-zero parity for RISC-V dev boards and CI and avoids fragment... | 096f79ab9824753cedd989da92076be12f0904ea | 0dc19f291b97826ab4fa3613e10cac5eadb8ae6b | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index bf6a5541fe..47d33a4a7b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -95,6 +95,10 @@ jobs:
os: ubuntu-latest
rust: stable
target: s390x-unknown-linux-gnu
+ - build: stable-riscv64
+ ... | [
".github/workflows/ci.yml",
".github/workflows/release.yml",
"CHANGELOG.md",
"tests/misc.rs"
] | [
{
"comment": "This section should be removed. The GitHub release binaries are covered at the top.",
"path": "README.md",
"hunk": "@@ -385,6 +385,17 @@ If you're an **ALT** user, you can install ripgrep from the\n $ sudo apt-get install ripgrep\n ```\n \n+If you're a **RISC-V Linux** user, precompiled bi... | diff --git a/tests/misc.rs b/tests/misc.rs
index 31f60ce915..1921a65f31 100644
--- a/tests/misc.rs
+++ b/tests/misc.rs
@@ -922,6 +922,8 @@ be, to a very large extent, the result of luck. Sherlock Holmes
eqnice!(expected, cmd.stdout());
});
+// lz4 decompression tool doesn't work under RISC-V QEMU emulation in C... | true | |
BurntSushi/ripgrep | 3,248 | issue_to_patch | Fix compression tests in QEMU cross-compilation environments | ## Problem
Compression tests (lz4, brotli, zstd) fail on `riscv64` when running under QEMU user-mode emulation. The tests attempt to execute compression commands even when the required tools are missing, instead of skipping as expected.
## Root Cause
This is caused by a known limitation in QEMU user-mode's `posix_... | cd1f981beafaeb9b61537e47e91314cea125400b | 0ab6dd87ce7427e869eaca194f6e2b7579a25936 | [
"tests/misc.rs",
"tests/util.rs"
] | [] | diff --git a/tests/misc.rs b/tests/misc.rs
index df79e95655..aae84da8d4 100644
--- a/tests/misc.rs
+++ b/tests/misc.rs
@@ -922,8 +922,6 @@ be, to a very large extent, the result of luck. Sherlock Holmes
eqnice!(expected, cmd.stdout());
});
-// lz4 decompression tool doesn't work under RISC-V QEMU emulation in C... | true | ||
BurntSushi/ripgrep | 3,229 | issue_to_patch | fix: clippy::derivable_impls | https://rust-lang.github.io/rust-clippy/master/index.html#/derivable_impls | 57c190d56eedac90c061a238b63dbfed434fee50 | ff8ba58cae09e52d5fc11b50324c2bb8ff03d12b | diff --git a/crates/core/flags/lowargs.rs b/crates/core/flags/lowargs.rs
index 184c96ae81..1941cae45d 100644
--- a/crates/core/flags/lowargs.rs
+++ b/crates/core/flags/lowargs.rs
@@ -229,13 +229,14 @@ pub(crate) enum GenerateMode {
}
/// Indicates how ripgrep should treat binary data.
-#[derive(Debug, Eq, PartialEq... | [
"crates/core/flags/lowargs.rs"
] | [] | true | ||
BurntSushi/ripgrep | 3,212 | issue_to_patch | ignore: only stat .jj if we actually care | I was comparing the work being done by fd and find and noticed (with strace -f -c -S calls) that fd was doing a ton of failed statx calls. Upon closer inspection it was stating .jj even though I was passing --no-ignore. Eventually I turned up this check in Ignore::add_child_path that was doing stat on .jj regardless of... | 36b7597693c994ffaf023b95d2e18aeeda7d9286 | b9517b5c3054385cdad0a4e681e1df5c7b0bcea5 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2b17916042..ecb564d925 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,11 @@ TBD
===
Unreleased changes. Release notes have not yet been written.
+Bug fixes:
+
+* [BUG #3212](https://github.com/BurntSushi/ripgrep/pull/3212):
+ Don't check for the existence of ... | [
"CHANGELOG.md",
"crates/ignore/src/dir.rs"
] | [] | true | ||
BurntSushi/ripgrep | 3,193 | issue_to_patch | ignore/types: add ssa | This PR adds support for [.ssa](https://en.wikipedia.org/wiki/Static_single-assignment_form) files as read by [qbe](https://c9x.me/compile/):
See: https://c9x.me/compile/doc/il.html#Input-Files | 38d630261aded3a8e535fe85761e68af35bc462d | aed3e978020eb2ea1a2986b74004c51e5b00aa17 | diff --git a/crates/ignore/src/default_types.rs b/crates/ignore/src/default_types.rs
index 4e060b76ae..de639783e3 100644
--- a/crates/ignore/src/default_types.rs
+++ b/crates/ignore/src/default_types.rs
@@ -274,6 +274,7 @@ pub(crate) const DEFAULT_TYPES: &[(&[&str], &[&str])] = &[
(&["spark"], &["*.spark"]),
... | [
"crates/ignore/src/default_types.rs"
] | [] | true | ||
BurntSushi/ripgrep | 3,195 | issue_to_patch | Line buffering appears broken in 15.0.0
### Please tick this box to confirm you have reviewed the above.
- [x] I have a different issue.
### What version of ripgrep are you using?
```
ripgrep 15.0.0
features:+pcre2
simd(compile):+SSE2,+SSSE3,+AVX2
simd(runtime):+SSE2,+SSSE3,+AVX2
PCRE2 10.45 is available (JIT is ... | searcher: fix regression with `--line-buffered` flag | In my fix for #3184, I actually had two fixes. One was a tweak to how we
read data and the other was a tweak to how we determined how much of the
buffer we needed to keep around. It turns out that fixing #3184 only
required the latter fix, found in commit
d4b77a8d8967ce1bf701ec65ceb9a75e85e5f2e0. The former fix also he... | 38d630261aded3a8e535fe85761e68af35bc462d | eb60087486a01f573cae9186fcca8973ef602dfd | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 22a2b39777..eaf51031a8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,12 @@
-TBD
-===
+15.0.1
+======
Unreleased changes. Release notes have not yet been written.
+Bug fixes:
+
+* [BUG #3194](https://github.com/BurntSushi/ripgrep/issues/3194):
+ Fix a regressi... | [
"CHANGELOG.md",
"crates/searcher/src/line_buffer.rs",
"crates/searcher/src/searcher/glue.rs"
] | [] | true | |
BurntSushi/ripgrep | 3,192 | issue_to_patch | add Cursor hyperlink alias | Add hyperlink alias for Cursor. It works the same way as the other VSCode forks.
I have the following code in my zshrc but I would like to add the alias officially.
```sh
if [[ "$TERM_PROGRAM" == 'vscode' ]]; then
alias rg='rg --hyperlink-format="cursor://file{path}:{line}:{column}"'
fi
``` | b3dc4b09988b4fe7d8ff69ad576623d57f7c3b75 | 78dafb3b52d35e221280b5b346282273c5151f6a | diff --git a/crates/printer/src/hyperlink/aliases.rs b/crates/printer/src/hyperlink/aliases.rs
index faefb20056..3db34e0112 100644
--- a/crates/printer/src/hyperlink/aliases.rs
+++ b/crates/printer/src/hyperlink/aliases.rs
@@ -4,6 +4,11 @@ use crate::hyperlink::HyperlinkAlias;
///
/// These need to be sorted by name.... | [
"crates/printer/src/hyperlink/aliases.rs"
] | [
{
"comment": "This should be at the top of the list. Note the failing test and the comments above.",
"path": "crates/printer/src/hyperlink/aliases.rs",
"hunk": "@@ -60,6 +60,11 @@ pub(super) const HYPERLINK_PATTERN_ALIASES: &[HyperlinkAlias] = &[\n \"VSCodium scheme (vscodium://)\",\n \"... | true | ||
BurntSushi/ripgrep | 3,190 | issue_to_patch | printer: fix `--stats` for `--json` | Somehow, the JSON printer seems to have never emitted correct summary
statistics. And I believe #3178 is the first time anyone has ever
reported it. I believe this bug has persisted for years. That's
surprising.
Anyway, the problem here was that we were bailing out of `finish()` on
the sink if we weren't supposed to p... | b610d1cb1506feab33459c5853e4c0d0cb16a6e2 | 5e0e5b538bfc297c92a27465bddf74f7d3f5d1bc | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 439c0b3da6..c52964ff1f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -50,6 +50,8 @@ Bug fixes:
Statically compile PCRE2 into macOS release artifacts on `aarch64`.
* [BUG #3173](https://github.com/BurntSushi/ripgrep/issues/3173):
Fix ancestor ignore filter bug when... | [
"CHANGELOG.md",
"crates/printer/src/json.rs"
] | [] | true | ||
BurntSushi/ripgrep | 3,189 | issue_to_patch | ignore::WalkBuilder.git_global(true) does not behave correctly with rooted files
This bug was originally reported in the helix repository: https://github.com/helix-editor/helix/issues/12604
I was doing a bit of a research in that issue, and I found that helix [is using the package `ignore`](https://github.com/helix-e... | ignore: fix global gitignore bug that arises with absolute paths | The `ignore` crate currently handles two different kinds of "global"
gitignore files: gitignores from `~/.gitconfig`'s `core.excludesFile`
and gitignores passed in via `WalkBuilder::add_ignore` (corresponding to
ripgrep's `--ignore-file` flag).
In contrast to any other kind of gitignore file, these gitignore files
sho... | 9ec08522bee566c8fbf03c340acd7a1ff1789a9f | 12b81e5ba3468269d60521902db3e6fd5b3d3826 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index ed4f567485..439c0b3da6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -50,6 +50,8 @@ Bug fixes:
Statically compile PCRE2 into macOS release artifacts on `aarch64`.
* [BUG #3173](https://github.com/BurntSushi/ripgrep/issues/3173):
Fix ancestor ignore filter bug when... | [
"CHANGELOG.md",
"crates/core/flags/hiargs.rs",
"crates/ignore/src/dir.rs",
"crates/ignore/src/gitignore.rs",
"crates/ignore/src/walk.rs",
"tests/regression.rs"
] | [] | diff --git a/tests/regression.rs b/tests/regression.rs
index 93e4ba6763..a196b401c1 100644
--- a/tests/regression.rs
+++ b/tests/regression.rs
@@ -1655,6 +1655,56 @@ rgtest!(r3173_hidden_whitelist_only_dot, |dir: Dir, _: TestCommand| {
eqnice!(cmd().args(&["--files", "./"]).stdout(), "./.foo.txt\n");
});
+// Se... | true |
BurntSushi/ripgrep | 3,186 | issue_to_patch | ignore: add lowercase r r_extensions | Add lowercase versions of *.Rmd and *.Rnw to the R type.
These extensions are less common, but useful given that the *.r extension is also added as the R type.
Thanks for all the work you do on rg, if this isn't wanted I'm happy to keep using my custom r type. | d4b77a8d8967ce1bf701ec65ceb9a75e85e5f2e0 | aedd5864b360d3e2756892da7731d8a40ca2f054 | diff --git a/crates/ignore/src/default_types.rs b/crates/ignore/src/default_types.rs
index 528415a041..4e060b76ae 100644
--- a/crates/ignore/src/default_types.rs
+++ b/crates/ignore/src/default_types.rs
@@ -219,7 +219,7 @@ pub(crate) const DEFAULT_TYPES: &[(&[&str], &[&str])] = &[
(&["qml"], &["*.qml"]),
(&["... | [
"crates/ignore/src/default_types.rs"
] | [] | true | ||
BurntSushi/ripgrep | 3,185 | issue_to_patch | Excessive slowdown with larger `-A` context windows?
### Please tick this box to confirm you have reviewed the above.
- [x] I have a different issue.
### What version of ripgrep are you using?
rg --version
ripgrep 14.1.1
features:-pcre2
simd(compile):+SSE2,-SSSE3,-AVX2
simd(runtime):+SSE2,+SSSE3,+AVX2
PCRE2 is no... | fix slow searching of `stdin` with large values of `-A/--after-context` | The commit messages have the details, but:
* When searching `stdin`, at least on my Linux machine, calls to `read` never seem to return more than 64K. This caused a pathological problem with large values of `-A/--after-context` that prevented ripgrep from amortizing `read` calls as well as it should.
* When `-A/--a... | de2567a4c76fa671005538d6cd841abc44932b9a | 146f78f77ff24e74fccf6da91a5e28ce4c48dfa1 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index b6ece534a8..ed4f567485 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,8 @@ Performance improvements:
Don't resolve helper binaries on Windows when `-z/--search-zip` isn't used.
* [PERF #2865](https://github.com/BurntSushi/ripgrep/pull/2865):
Avoid using pat... | [
"CHANGELOG.md",
"crates/searcher/src/line_buffer.rs",
"crates/searcher/src/searcher/core.rs",
"crates/searcher/src/searcher/glue.rs"
] | [] | true | |
BurntSushi/ripgrep | 3,182 | issue_to_patch | rg panic caused by --replace, --multiline, a particular pattern, and search text containing repeats and newlines
### Please tick this box to confirm you have reviewed the above.
- [x] I have a different issue.
### What version of ripgrep are you using?
ripgrep 14.1.1
features:+pcre2
simd(compile):+SSE2,-SSSE3,-AVX... | printer: fix panic in replacements in look-around corner case | The abstraction boundary fuck up is the gift that keeps on giving. It
turns out that the invariant that the match would never exceed the range
given is not always true. So we kludge around it.
Fixes #3180
| 916415857f084e63efda03cf25a67fe7f6d24244 | 1e80e6e8a4ba4126e04df36aa9558bf6cb6ce73c | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8f0177d12e..b6ece534a8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,8 @@ Unreleased changes. Release notes have not yet been written.
Performance improvements:
+* [PERF #2111](https://github.com/BurntSushi/ripgrep/issues/2111):
+ Don't resolve helper binar... | [
"CHANGELOG.md",
"crates/printer/src/util.rs",
"tests/regression.rs"
] | [] | diff --git a/tests/regression.rs b/tests/regression.rs
index f3ba63b053..93e4ba6763 100644
--- a/tests/regression.rs
+++ b/tests/regression.rs
@@ -1654,3 +1654,16 @@ rgtest!(r3173_hidden_whitelist_only_dot, |dir: Dir, _: TestCommand| {
eqnice!(cmd().args(&["--files", "."]).stdout(), "./.foo.txt\n");
eqnice!(c... | true |
BurntSushi/ripgrep | 3,181 | issue_to_patch | decompression binaries are searched for even when they will never be used
#### Feature request
Switch for turn off tools check
For example, lets say I want to do multiple replacements like so:
```
rg --passthru "!RE1!" "!file!" -or "!RP1!" |^
rg --passthru "!RE2!" -or "!RP2!" |^
...
rg --passthru "!RE... | core: don't build decompression reader unless we intend to use it | Building it can consume resources. In particular, on Windows, the
various binaries are eagerly resolved.
I think this originally wasn't done. The eager resolution was added
later for security purposes. But the "eager" part isn't actually
necessary.
It would probably be better to change the decompression reader to do
... | 5c42c8c48f4163ba7c0662cb70dbf61f9d670d9a | e4f0d40056b7438f00cc6dc3a092cf775e5801b2 | diff --git a/crates/core/search.rs b/crates/core/search.rs
index d03433f6f8..2fb4cbadc2 100644
--- a/crates/core/search.rs
+++ b/crates/core/search.rs
@@ -41,7 +41,6 @@ impl Default for Config {
pub(crate) struct SearchWorkerBuilder {
config: Config,
command_builder: grep::cli::CommandReaderBuilder,
- dec... | [
"crates/core/search.rs"
] | [] | true | |
BurntSushi/ripgrep | 3,177 | issue_to_patch | fix a few small outstanding bugs | This combines multiple fixes in one PR. See the commit messages
for details.
| 7c2161d68755e2c47db26717f6757f5099d500e4 | 88c471220d1564296c258c5cdd5990858baea409 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5dfe1f5a84..91d2994098 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,9 +12,11 @@ Bug fixes:
* [BUG #829](https://github.com/BurntSushi/ripgrep/issues/829),
[BUG #2731](https://github.com/BurntSushi/ripgrep/issues/2731),
[BUG #2747](https://github.com/BurntSush... | [
"CHANGELOG.md",
"crates/core/flags/defs.rs",
"tests/feature.rs",
"tests/misc.rs",
"tests/regression.rs",
"tests/util.rs"
] | [] | diff --git a/tests/feature.rs b/tests/feature.rs
index f79186d2ed..1424249de8 100644
--- a/tests/feature.rs
+++ b/tests/feature.rs
@@ -154,7 +154,7 @@ test
// parent ignore files and manually specified ignore files.
let mut cmd = dir.command();
cmd.args(&["--ignore-file", "../.not-an-ignore", "-l", "test... | true | |
BurntSushi/ripgrep | 3,174 | issue_to_patch | hidden files whitelisted by ancestor .ignore are not searched when . is directory argument
### Please tick this box to confirm you have reviewed the above.
- [x] I have a different issue.
### What version of ripgrep are you using?
```
ripgrep 14.1.1
features:+pcre2
simd(compile):+SSE2,-SSSE3,-AVX2
simd(runtime):+S... | ignore: fix problem with searching whitelisted hidden files | ... specifically, when the whitelist comes from a _parent_ gitignore
file.
Our handling of parent gitignores is pretty ham-fisted and has been a
source of some unfortunate bugs. The problem is that we need to strip
the parent path from the path we're searching in order to correctly
apply the globs. But getting this st... | bb88a1ac45c70bef97e0d6ccd6e91595610de860 | ce3d884a06ab68082846ed1a58e904904330ee23 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 075b997c7f..23efcadc7b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -37,6 +37,8 @@ Bug fixes:
Ensure hyphens in flag names are escaped in the roff text for the man page.
* [BUG #3155](https://github.com/BurntSushi/ripgrep/issues/3155):
Statically compile PCRE2 in... | [
"CHANGELOG.md",
"crates/ignore/src/dir.rs",
"tests/regression.rs"
] | [] | diff --git a/tests/regression.rs b/tests/regression.rs
index 8dd1ba7191..7f9818f999 100644
--- a/tests/regression.rs
+++ b/tests/regression.rs
@@ -1586,3 +1586,24 @@ YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY\n \
eqnice!("test\n", got);
}
);
+
+// See: https://github.com... | true |
BurntSushi/ripgrep | 3,162 | issue_to_patch | Add `min_depth` to `ignore::WalkBuilder`
#### Describe your feature request
I am migrating from `walkdir` to `ignore` so I can support `.dockerignore` files, and we use the `walkdir::WalkDir::min_depth` method which has no equivalent in `ignore::WalkBuilder`.
I'd be willing to add the method.
Also, thanks for all t... | Implement min depth on `ignore` | Closes #3158
This replicates the behavior of `walkdir`, where passing `.min_depth(1)`, `.min_depth(0)` or no `min_depth` will have the same behavior.
Passing `min_depth(Some(2)` to the builder to a directory that looks like this:
```
.
├── a
│ ├── b
│ │ ├── c
│ │ │ └── foo
│ │ └── foo
│... | 9d8016d10c94a5af2768eb6dd0440386a7d317a0 | 6dadbcaa31799bebe397d6103a5204ff7f5d0657 | diff --git a/crates/ignore/src/walk.rs b/crates/ignore/src/walk.rs
index 485635196a..3e06fb3eab 100644
--- a/crates/ignore/src/walk.rs
+++ b/crates/ignore/src/walk.rs
@@ -484,6 +484,7 @@ pub struct WalkBuilder {
paths: Vec<PathBuf>,
ig_builder: IgnoreBuilder,
max_depth: Option<usize>,
+ min_depth: Opt... | [
"crates/ignore/src/walk.rs"
] | [] | true | |
BurntSushi/ripgrep | 3,166 | issue_to_patch | `--max-count` not working properly with `--multiline` if matches are on consecutive lines
### Please tick this box to confirm you have reviewed the above.
- [x] I have a different issue.
### What version of ripgrep are you using?
ripgrep 14.1.1 (rev 4649aa9700)
features:+pcre2
PCRE2 10.43 is available (JIT is una... | printer: finish removal of `max_matches` | This finishes what I started in commit
a6e0be3c909c5c09e5fb402c907f3beb88cfb4c4.
Specifically, the `max_matches` configuration has been moved to the
`grep-searcher` crate and *removed* from the `grep-printer` crate. The
commit message has the details for why we're doing this, but the short
story is to fix #3076 wi... | 9802945e6342ec284633924cb7d8d3ce67204995 | 81b166187f8bed4c623856b2541efb29a07867f0 | diff --git a/crates/core/flags/hiargs.rs b/crates/core/flags/hiargs.rs
index a0b3282c93..a98bde23c6 100644
--- a/crates/core/flags/hiargs.rs
+++ b/crates/core/flags/hiargs.rs
@@ -596,7 +596,6 @@ impl HiArgs {
) -> grep::printer::JSON<W> {
grep::printer::JSONBuilder::new()
.pretty(false)
- ... | [
"crates/core/flags/hiargs.rs",
"crates/printer/src/json.rs",
"crates/printer/src/summary.rs"
] | [] | true | |
BurntSushi/ripgrep | 3,159 | issue_to_patch | doc: update the CentOS, RHEL and Rocky Linux installation instructions | I've split the previously singular "CentOS/RHEL/Rocky" section into 3
sections. They each benefit from having their own steps.
I've also copied steps from [EPEL Getting Started] documentation,
including steps that don't seem to be required because it seems to be
best practice (although I do not understand it). No... | fdea9723cac34b6e93e259c2366c94e8319de0ca | 44cb0204ade22070f0742d67ffe6e299fdc02f23 | diff --git a/README.md b/README.md
index 3babb83785..73868ac5c3 100644
--- a/README.md
+++ b/README.md
@@ -302,15 +302,30 @@ and **openSUSE Leap** since 15.1.
$ sudo zypper install ripgrep
```
-If you're a **RHEL/CentOS/Rocky Linux 9** user, you can install ripgrep from
-the [EPEL](https://docs.fedoraproject.org/en... | [
"README.md"
] | [] | true | ||
BurntSushi/ripgrep | 3,157 | issue_to_patch | rg -c omits files when a NUL byte is encountered after an earlier match
### Please tick this box to confirm you have reviewed the above.
- [x] I have a different issue.
### What version of ripgrep are you using?
```
ripgrep 14.1.1
features:+pcre2
simd(compile):+SSE2,+SSSE3,-AVX2
simd(runtime):+SSE2,+SSSE3,+AVX2
PC... | cli: document that `-c/--count` can be inconsistent with `-l/--files-with-matches` | This is unfortunate, but is a known bug that I don't think can be fixed
without either making `-l/--files-with-matches` much slower or changing
what "binary filtering" means by default.
In this PR, we document this inconsistency since users may find it quite
surprising. The actual work-around is to disable binary filt... | c1fc6a5eb8c971fc43041d3df34cf8bd49f31032 | 956e84d9d878f65391fc21962c10cccb819eaa6d | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7fe2cbe16e..075b997c7f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -31,6 +31,8 @@ Bug fixes:
Preserve line terminators when using `-r/--replace` flag.
* [BUG #3108](https://github.com/BurntSushi/ripgrep/issues/3108):
Fix a bug where `-q --files-without-match` in... | [
"CHANGELOG.md",
"crates/core/flags/defs.rs",
"tests/binary.rs",
"tests/regression.rs"
] | [] | diff --git a/tests/binary.rs b/tests/binary.rs
index fd145ce1ea..73639c10a4 100644
--- a/tests/binary.rs
+++ b/tests/binary.rs
@@ -429,3 +429,40 @@ hay:1867:\"And yet you say he is not a medical student?\"
";
eqnice!(expected, cmd.stdout());
});
+
+// See: https://github.com/BurntSushi/ripgrep/issues/3131
+rgtes... | true |
BurntSushi/ripgrep | 3,156 | issue_to_patch | ripgrep is not self-contained on aarach64 darwin
### Please tick this box to confirm you have reviewed the above.
- [x] I have a different issue.
### What version of ripgrep are you using?
14.1.1
### How did you install ripgrep?
Download tarball from github release
### What operating system are you using ripgrep... | release: build aarch64 artifacts for macos on GitHub Actions | GitHub now supports this natively, so there's no need for me to do it
any more.
Fixes #3155
| 8b5d3d1c1e3b0e32f22aa634d000b314f6d4d465 | f05549d7be238c622c516bc574dd7aa174a87f3a | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 9a9cc0386e..3139d03247 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -114,6 +114,10 @@ jobs:
os: macos-latest
rust: nightly
target: x86_64-apple-darwin
+ - build: ... | [
".github/workflows/release.yml",
"CHANGELOG.md",
"RELEASE-CHECKLIST.md",
"ci/build-and-publish-m2"
] | [] | true | |
BurntSushi/ripgrep | 3,154 | issue_to_patch | Inconsistent behaviour when using --files-with-matches vs without
### Please tick this box to confirm you have reviewed the above.
- [x] I have a different issue.
### What version of ripgrep are you using?
ripgrep 14.1.1
features:+pcre2
simd(compile):+SSE2,-SSSE3,-AVX2
simd(runtime):+SSE2,+SSSE3,+AVX2
PCRE2 10.43... | printer: hack in a fix for `-l/--files-with-matches` when using `--pcre2 --multiline` with look-around | The underlying issue here is #2528, which was introduced by commit
efd9cfb2fc1f0233de9eda4c03416d32ef2c3ce8 which fixed another bug.
For the specific case of "did a file match," we can always assume the
match count is at least 1 here. But this doesn't fix the underlying
problem.
Fixes #3139
| 491bf3f6d5bc1a621754440e291960f460a9c003 | 635afac2ebe52dcb5c8393567f204703d0c7c347 | diff --git a/crates/printer/src/summary.rs b/crates/printer/src/summary.rs
index 86ce09544c..615abd2e15 100644
--- a/crates/printer/src/summary.rs
+++ b/crates/printer/src/summary.rs
@@ -683,7 +683,11 @@ impl<'p, 's, M: Matcher, W: WriteColor> Sink for SummarySink<'p, 's, M, W> {
true
... | [
"crates/printer/src/summary.rs",
"tests/regression.rs"
] | [] | diff --git a/tests/regression.rs b/tests/regression.rs
index 2f1ba857fc..b3d7fb16e9 100644
--- a/tests/regression.rs
+++ b/tests/regression.rs
@@ -1544,3 +1544,44 @@ rgtest!(
cmd.args(&["--files", "-g", "[abc"]).assert_err();
}
);
+
+rgtest!(
+ r3139_multiline_lookahead_files_with_matches,
+ |dir: ... | true |
BurntSushi/ripgrep | 3,153 | issue_to_patch | update to PCRE2 10.46 (for static builds) | This also bumps the rest of our Rust dependencies.
| 1b6177bc5c53c3007c61bba4100a98d5d2a856ae | f84cfbbd8be5d4c63994602311c7ef21e75dd6a2 | diff --git a/Cargo.lock b/Cargo.lock
index 49af1f7871..d1e2c03c20 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
-version = 3
+version = 4
[[package]]
name = "aho-corasick"
@@ -13,25 +13,19 @@ dependencies = [
... | [
"Cargo.lock"
] | [] | true | ||
BurntSushi/ripgrep | 3,152 | issue_to_patch | cargo: set MSRV to 1.85 | I believe the current stable version of Debian packages 1.85 rustc. So
if the next release of ripgrep uses a higher MSRV, then I think Debian
won't be able to package it.
It also turned out that I wasn't using anything from beyond Rust 1.85
anyway.
It's likely that I could make use of let-chains in various places, bu... | a7b7d81d66b6e2e4311d5dd0683022c2978650f1 | e3addd3f675cef740381bbd40d27c11ee925e691 | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 33622fcabc..bf6a5541fe 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -53,7 +53,7 @@ jobs:
include:
- build: pinned
os: ubuntu-latest
- rust: 1.88.0
+ rust: 1.85.0
- bu... | [
".github/workflows/ci.yml",
"Cargo.toml",
"README.md"
] | [] | true | ||
BurntSushi/ripgrep | 3,151 | issue_to_patch | fix: clippy errors | I opened the project in RustRover on Windows after you merged the rollup branch, and it showed a few Clippy errors. Those were displayed by highlighting a few files in red, which is annoying, so I thought I'd rather get rid of them.
This is basically the equivalent of handling the output of `cargo clippy -- -A warni... | bb8172fe9baa450ede7ff84677ab45048675fd02 | 2355ee6ae93d400e876aca526d7b7c751ad21bad | diff --git a/crates/cli/src/decompress.rs b/crates/cli/src/decompress.rs
index 9e93c98257..0bfc93e69f 100644
--- a/crates/cli/src/decompress.rs
+++ b/crates/cli/src/decompress.rs
@@ -177,7 +177,7 @@ impl DecompressionMatcher {
/// If there are multiple possible commands matching the given path, then
/// the c... | [
"crates/cli/src/decompress.rs",
"crates/ignore/examples/walk.rs",
"crates/printer/src/json.rs",
"crates/printer/src/jsont.rs"
] | [] | true | ||
BurntSushi/ripgrep | 3,149 | issue_to_patch | rollup: clear the extant PR queue | This rolls up a number of outstanding PRs into one.
Where possible, I preserved author information in each commit.
Most non-trivial PRs required changes. Instead of letting the PRs go
through more rounds of feedback, I find it more efficient to just lump
everything in all at once.
| 119a58a400ea948c2d2b0cd4ec58361e74478641 | 14d19122f372292238c1c82d70673973a54cd207 | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5389cafa0c..33622fcabc 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -99,11 +99,14 @@ jobs:
os: macos-latest
rust: nightly
- build: win-msvc
- os: windows-2022
+ os: windows-... | [
".github/workflows/ci.yml",
".github/workflows/release.yml",
"CHANGELOG.md",
"Cargo.lock",
"Cargo.toml",
"FAQ.md",
"README.md",
"build.rs",
"ci/ubuntu-install-packages",
"crates/cli/Cargo.toml",
"crates/cli/src/hostname.rs",
"crates/cli/src/lib.rs",
"crates/core/flags/complete/fish.rs",
"c... | [] | diff --git a/crates/ignore/tests/gitignore_matched_path_or_any_parents_tests.rs b/crates/ignore/tests/gitignore_matched_path_or_any_parents_tests.rs
index 09ec83ad1e..ecb7b47e35 100644
--- a/crates/ignore/tests/gitignore_matched_path_or_any_parents_tests.rs
+++ b/crates/ignore/tests/gitignore_matched_path_or_any_parent... | true | |
BurntSushi/ripgrep | 3,109 | issue_to_patch | msrv: bump to Rust 1.88 | This is to prep for the next release. I don't know if the requirement
will actually be for Rust 1.88, but it is intended to support the latest
version of stable Rust.
| 3b7fd442a6f3aa73f650e763d7cbb902c03d700e | 682833b6506f98304d07bdde46cb199c034e0d1d | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4c8a3bfee4..5389cafa0c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -53,7 +53,7 @@ jobs:
include:
- build: pinned
os: ubuntu-latest
- rust: 1.74.0
+ rust: 1.88.0
- bu... | [
".github/workflows/ci.yml",
"Cargo.toml",
"README.md"
] | [] | true | ||
BurntSushi/ripgrep | 3,058 | issue_to_patch | Update README.md | Update the README file to indicate that Debian users can download and use the binaries provided by the latest version 14.1.1 . | 6dfaec03e830892e787686917509c17860456db1 | 590d72016a5b5349442a7a55886d98c320c45770 | diff --git a/README.md b/README.md
index a429087603..34e81633d5 100644
--- a/README.md
+++ b/README.md
@@ -336,8 +336,8 @@ then ripgrep can be installed using a binary `.deb` file provided in each
[ripgrep release](https://github.com/BurntSushi/ripgrep/releases).
```
-$ curl -LO https://github.com/BurntSushi/ripgre... | [
"README.md"
] | [] | true | ||
BurntSushi/ripgrep | 3,028 | issue_to_patch | build(deps): bump crossbeam-channel from 0.5.13 to 0.5.15 | Bumps [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam) from 0.5.13 to 0.5.15.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/crossbeam-rs/crossbeam/releases">crossbeam-channel's releases</a>.</em></p>
<blockquote>
<h2>crossbeam-channel 0.5.15</h2>
<ul>
<li>Fix r... | 5fbc4fee64131b5cd14675be71e43768a9763553 | 00cbee12335a3d01c63976bfe3a063a48e977af0 | diff --git a/Cargo.lock b/Cargo.lock
index 07420ec4e8..fb94f9d016 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -47,9 +47,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "crossbeam-channel"
-version = "0.5.13"
+version = "0.5.15"
source = "registry+https://github... | [
"Cargo.lock",
"crates/ignore/Cargo.toml"
] | [] | true | ||
BurntSushi/ripgrep | 3,023 | issue_to_patch | Fix Seed7 file extension: .s7d -> .sd7 | ... murphy's law never fails... Sorry for that. | 004370bd1619183b54dbaa41719728edfe892ac6 | b25907186b8b25b62e09189878d14568acdeb4e2 | diff --git a/crates/ignore/src/default_types.rs b/crates/ignore/src/default_types.rs
index f1c799aae1..35cb197560 100644
--- a/crates/ignore/src/default_types.rs
+++ b/crates/ignore/src/default_types.rs
@@ -232,7 +232,7 @@ pub(crate) const DEFAULT_TYPES: &[(&[&str], &[&str])] = &[
(&["rust"], &["*.rs"]),
(&["... | [
"crates/ignore/src/default_types.rs"
] | [] | true | ||
BurntSushi/ripgrep | 3,022 | issue_to_patch | Add support for Seed7 files | For more info on the Seed7 programming Language see:
- on Wikipedia: https://en.wikipedia.org/wiki/Seed7
- Seed7 home: https://seed7.sourceforge.net/
- Seed7 repo: https://github.com/ThomasMertes/seed7 | de4baa10024f2cb62d438596274b9b710e01c59b | 53f8694213c548623f0eaf02d9edba90b35fd8c7 | diff --git a/crates/ignore/src/default_types.rs b/crates/ignore/src/default_types.rs
index 2cf8ad8079..f1c799aae1 100644
--- a/crates/ignore/src/default_types.rs
+++ b/crates/ignore/src/default_types.rs
@@ -232,6 +232,7 @@ pub(crate) const DEFAULT_TYPES: &[(&[&str], &[&str])] = &[
(&["rust"], &["*.rs"]),
(&["... | [
"crates/ignore/src/default_types.rs"
] | [] | true | ||
BurntSushi/ripgrep | 3,003 | issue_to_patch | globset: escape `{` and `}` in `escape` | This appears to be an oversight from when `escape` was
implemented in #2061.
| e2362d4d5185d02fa857bf381e7bd52e66fafc73 | afa8bfb10c21755a814b7c090f6fac1b87a52890 | diff --git a/crates/globset/src/lib.rs b/crates/globset/src/lib.rs
index b1fc696af2..e804e12a58 100644
--- a/crates/globset/src/lib.rs
+++ b/crates/globset/src/lib.rs
@@ -928,13 +928,26 @@ impl RequiredExtensionStrategyBuilder {
///
/// The escaping works by surrounding meta-characters with brackets. For
/// example... | [
"crates/globset/src/lib.rs"
] | [] | true | ||
BurntSushi/ripgrep | 2,970 | issue_to_patch | Fix the CI workflow broken by WASI compilation target rename | For more info visit the official rust [blog](https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html). | 94305125ef33b86151b6cd2ce2b33d641f6b6ac3 | 6f4f4b4fda44237243a630a08cc1e887fcb4648f | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 532e2e9c9b..4c8a3bfee4 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -189,7 +189,7 @@ jobs:
shell: bash
run: ${{ env.CARGO }} test --bin rg ${{ env.TARGET_FLAGS }} flags::defs::tests::available_shorts -- --noc... | [
".github/workflows/ci.yml"
] | [] | true | ||
CanCanCommunity/cancancan | 233 | issue_to_patch | Correct information about strong parameters. | Update README based on the fact that CanCan doesn't actually
do anything special with `update_params`, as per discussion in #184.
| 15c51b9e89015af1d062fe43d370cdfbbb026c60 | e7f6f81477cc6818ea644a0284b52f99577e10c7 | diff --git a/README.md b/README.md
index 266a411d..f96c444d 100644
--- a/README.md
+++ b/README.md
@@ -89,9 +89,26 @@ See [Authorizing Controller Actions](https://github.com/CanCanCommunity/cancanca
When using `strong_parameters` or Rails 4+, you have to sanitize inputs before saving the record, in actions such as `... | [
"README.md"
] | [] | true | ||
CanCanCommunity/cancancan | 675 | issue_to_patch | Support modifying the `accessible_by` querying strategy on a per-query basis | See discussion at https://github.com/CanCanCommunity/cancancan/discussions/668 | 07dc15d55fe79fd46fabf59d16b815fa98d03d53 | c220e8741f11cc8313d57b3c0b9baf5cf5b67d59 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index d9a426283..b0952e3ff 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## Unreleased
+
+* [#675](https://github.com/CanCanCommunity/cancancan/pull/675): Support modifying the `accessible_by` querying strategy on a per-query basis. ([@ghiculescu][])
+
## 3.2.1
... | [
"CHANGELOG.md",
"lib/cancan/config.rb",
"lib/cancan/model_additions.rb",
"spec/cancan/model_adapters/active_record_adapter_spec.rb"
] | [] | diff --git a/spec/cancan/model_adapters/active_record_adapter_spec.rb b/spec/cancan/model_adapters/active_record_adapter_spec.rb
index df2a019e2..2ac33756b 100644
--- a/spec/cancan/model_adapters/active_record_adapter_spec.rb
+++ b/spec/cancan/model_adapters/active_record_adapter_spec.rb
@@ -817,6 +817,101 @@ class Tra... | true | |
CanCanCommunity/cancancan | 849 | issue_to_patch | Update the tests matrix | Let's refresh the matrix of tests, removing ruby 2.6 and rails < 5.2.
We also add rails 7.0 and 7.1 and ruby 3.2 and 3.3.
We stop testing on jruby and truffleruby because tests are failing right now | 54a605c10b839fed0160074a66e732e8d9fb522f | 4112cbc80f8f552c90ff7fe31f1ad5d406ce946b | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 08d0a5af..49687f7a 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -14,41 +14,38 @@ jobs:
strategy:
fail-fast: false
matrix:
- ruby: ['2.6', '2.7', '3.0', 'jruby', 'truffleruby']
- gem... | [
".github/workflows/test.yml",
".gitignore",
".rubocop.yml",
".rubocop_todo.yml",
"Appraisals",
"gemfiles/activerecord_5.1.0.gemfile",
"gemfiles/activerecord_5.2.2.gemfile",
"gemfiles/activerecord_6.0.0.gemfile",
"gemfiles/activerecord_6.1.0.gemfile",
"gemfiles/activerecord_7.0.0.gemfile",
"gemfi... | [
{
"comment": "> We stop testing on jruby and truffleruby because tests are failing right now\r\n\r\nIt seems specs should pass on TruffleRuby now (or actually fail in the same way they are failing on CRuby on the `develop` branch).\r\n\r\nI've enabled truffleruby-head in a fork (https://github.com/andrykonchin/... | true | ||
CanCanCommunity/cancancan | 839 | issue_to_patch | In permitted_attributes, switch from database column detection to Rails attributes detection. Addresses #838 | This pull request addresses #838 and makes Cancancan "see" attributes that are not backed by the database. It enables code like the following:
```ruby
class Foo < ApplicationRecord
attribute :bar
end
```
With this pull request, cancancan's `permitted_attributes` will "see" and include `:bar` even when there... | 178d2c5bdf97225751a1a089e9815a4060b03265 | f68d752f735d3af7a201b41fd34a5f96d1678ac6 | diff --git a/lib/cancan/ability/strong_parameter_support.rb b/lib/cancan/ability/strong_parameter_support.rb
index 31da7457..892d250a 100644
--- a/lib/cancan/ability/strong_parameter_support.rb
+++ b/lib/cancan/ability/strong_parameter_support.rb
@@ -31,7 +31,7 @@ def get_attributes(rule, subject)
klass = subj... | [
"lib/cancan/ability/strong_parameter_support.rb",
"spec/cancan/ability_spec.rb"
] | [] | diff --git a/spec/cancan/ability_spec.rb b/spec/cancan/ability_spec.rb
index 486cbc42..3951f3b2 100644
--- a/spec/cancan/ability_spec.rb
+++ b/spec/cancan/ability_spec.rb
@@ -5,6 +5,21 @@
describe CanCan::Ability do
before(:each) do
(@ability = double).extend(CanCan::Ability)
+
+ connect_db
+ ActiveRecor... | true | |
CanCanCommunity/cancancan | 2 | issue_to_patch | Correct link in README.rdoc | correct link to ryan bates' cancan on github
| bca190eee6308089408e215de73416d398aefd75 | d58734d0668bac800be387729c91548083c61926 | diff --git a/README.rdoc b/README.rdoc
index 3b6f924b..b64530c4 100644
--- a/README.rdoc
+++ b/README.rdoc
@@ -10,7 +10,7 @@ CanCan is an authorization library for Ruby on Rails which restricts what resour
== Mission
-This repo is a continuation of the dead CanCan[https://github.com/rbates/cancan] project. Our mis... | [
"README.rdoc"
] | [] | true | ||
CanCanCommunity/cancancan | 831 | issue_to_patch | Update friendly_id.md | fixing typo in class name. remove 4 from ActiveRecord4Adapter | cbc81ed56d9467ffe07370576a218981aaf9468f | 03eb92aee1b6be771c3055e0853ad72006e92669 | diff --git a/docs/friendly_id.md b/docs/friendly_id.md
index b20c03eb..21f3b678 100644
--- a/docs/friendly_id.md
+++ b/docs/friendly_id.md
@@ -16,7 +16,7 @@ if defined?(CanCanCan)
module CanCan
module ModelAdapters
- class ActiveRecord4Adapter < AbstractAdapter
+ class ActiveRecordAdapter < Abstract... | [
"docs/friendly_id.md"
] | [] | true | ||
CanCanCommunity/cancancan | 829 | issue_to_patch | Update CONTRIBUTING.md | Fix link from Wiki to Docs | cbc81ed56d9467ffe07370576a218981aaf9468f | 8cba96f7e7e29e8d18662756c00399b7e92427ff | diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 7252e2f3..ad5ac462 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -2,7 +2,7 @@
### Reporting an Issue
-1. If you have any questions about CanCanCan, search the [Wiki](https://github.com/cancancommunity/cancancan/wiki) or
+1. If you have any questions abou... | [
"CONTRIBUTING.md"
] | [] | true | ||
CanCanCommunity/cancancan | 804 | issue_to_patch | Update define_check_abilities.md | Correct some confusing grammar issues | 7c99c593dd55127db16b0920167814a296c38e0d | 7ad688b8e6134a46e71a8d4894979dd8a9a3a7d7 | diff --git a/docs/define_check_abilities.md b/docs/define_check_abilities.md
index 476b9e14..856232ae 100644
--- a/docs/define_check_abilities.md
+++ b/docs/define_check_abilities.md
@@ -227,6 +227,6 @@ end
some_user.can? :update, @article
```
-That's everything you know about defining and checking abilities. The D... | [
"docs/define_check_abilities.md"
] | [] | true | ||
CanCanCommunity/cancancan | 828 | issue_to_patch | Update rules_compression.md | Fix link from wiki to docs | cbc81ed56d9467ffe07370576a218981aaf9468f | 89adae98676c35706671e7702360e4deb21517a1 | diff --git a/docs/rules_compression.md b/docs/rules_compression.md
index a535dbf3..3eb76848 100644
--- a/docs/rules_compression.md
+++ b/docs/rules_compression.md
@@ -52,4 +52,4 @@ becomes
# nothing
```
-These optimizations allow you to follow the strategy of ["Give Permissions, don't take them"](https://github.com... | [
"docs/rules_compression.md"
] | [] | true | ||
CanCanCommunity/cancancan | 836 | issue_to_patch | Add documentation for id_param to authorize_resource | Currently the id_param is not documented for authorize_resource. This commit adds the documentation. | 178d2c5bdf97225751a1a089e9815a4060b03265 | 57209bfcd8b4c221b6c9a4ccce32413235c7da04 | diff --git a/lib/cancan/controller_additions.rb b/lib/cancan/controller_additions.rb
index 0c84f83e..a51f5b96 100644
--- a/lib/cancan/controller_additions.rb
+++ b/lib/cancan/controller_additions.rb
@@ -171,6 +171,11 @@ def load_resource(*args)
# [:+instance_name+]
# The name of the instance variable fo... | [
"lib/cancan/controller_additions.rb"
] | [] | true | ||
CanCanCommunity/cancancan | 847 | issue_to_patch | Fix: rule_spec should honor DB setting | I noticed when running db-specific tests e.g.
```
DB='postgres' bundle exec appraisal activerecord_6.1.0 rake
```
that `spec/cancan/rule_spec.rb` could fail if sqlite not available, because it was ignoring the DB context and always/only running with sqlite.
This is just a quick fix to ensure that `spec/cancan/r... | 178d2c5bdf97225751a1a089e9815a4060b03265 | fb52652ca369c3f4884faa1ded4146af7f1d7ca4 | [
"spec/cancan/rule_spec.rb"
] | [] | diff --git a/spec/cancan/rule_spec.rb b/spec/cancan/rule_spec.rb
index 7de14c1d..3f789fd1 100644
--- a/spec/cancan/rule_spec.rb
+++ b/spec/cancan/rule_spec.rb
@@ -61,7 +61,7 @@ def count_queries(&block)
end
before do
- ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory... | true | ||
CanCanCommunity/cancancan | 841 | issue_to_patch | add docs page to cancancan using vitepress | I think cancancan could benefit a docs page using vitepress.
VitePress https://vitepress.dev is already used by many others and it allows user to create fast docs page.
You can see a preview at: https://cancancan.pages.dev (i will remove this project so you can claim this name)
for the best experience, the pag... | 178d2c5bdf97225751a1a089e9815a4060b03265 | 56e1c57e396f8acaa2ccc8a27ad6b0d0def25543 | diff --git a/.gitignore b/.gitignore
index 5b936d51..8ec036cb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,6 @@ Gemfile.lock
.ruby-version
.ruby-gemset
/tmp
+docs/.vitepress/cache
+node_modules
+docs/.vitepress/dist
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 7252e2f3..a925aa7e 100644
--- a/CONTRIB... | [
".gitignore",
"CONTRIBUTING.md",
"docs/.vitepress/config.mts",
"docs/.vitepress/theme/index.ts",
"docs/.vitepress/theme/style.css",
"docs/check_abilities_mistakes.md",
"docs/index.md",
"docs/introduction.md",
"docs/model_adapter.md",
"docs/public/apple-touch-icon.png",
"docs/public/cancancan.png... | [
{
"comment": "assuming this will be the domain",
"path": "docs/.vitepress/config.mts",
"hunk": "@@ -0,0 +1,85 @@\n+import { defineConfig } from 'vitepress'\n+\n+// https://vitepress.dev/reference/site-config\n+export default defineConfig({\n+ title: \"CanCanCan\",\n+ description: \"The authorization G... | true | ||
CanCanCommunity/cancancan | 841 | comment_to_fix | add docs page to cancancan using vitepress | ```suggestion
hostname: 'https://cancancan.dev'
``` | 178d2c5bdf97225751a1a089e9815a4060b03265 | 56e1c57e396f8acaa2ccc8a27ad6b0d0def25543 | diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts
new file mode 100644
index 00000000..d492843d
--- /dev/null
+++ b/docs/.vitepress/config.mts
@@ -0,0 +1,97 @@
+import { defineConfig } from 'vitepress'
+
+// https://vitepress.dev/reference/site-config
+export default defineConfig({
+ title: "CanCanC... | [
"docs/.vitepress/config.mts"
] | [
{
"comment": "```suggestion\r\n hostname: 'https://cancancan.dev'\r\n```",
"path": "docs/.vitepress/config.mts",
"hunk": "@@ -0,0 +1,97 @@\n+import { defineConfig } from 'vitepress'\n+\n+// https://vitepress.dev/reference/site-config\n+export default defineConfig({\n+ title: \"CanCanCan\",\n+ descr... | true | ||
CanCanCommunity/cancancan | 843 | issue_to_patch | Compress duplicates rules | Hello 👋
In my current project, some rules are duplicated and applied several times. It creates big SQL queries that are hard to read. With this PR, the duplicated rules are removed and the SQL query is equivalent and simpler.
We also have some performance gain on some specific queries.
Let me know if I nee... | 178d2c5bdf97225751a1a089e9815a4060b03265 | 4caca501b6079f35ebeb5cde8906b8eaad0e347a | diff --git a/lib/cancan/rules_compressor.rb b/lib/cancan/rules_compressor.rb
index 01b9e325..46f5a4cb 100644
--- a/lib/cancan/rules_compressor.rb
+++ b/lib/cancan/rules_compressor.rb
@@ -11,6 +11,7 @@ def initialize(rules)
end
def compress(array)
+ array = simplify(array)
idx = array.rindex(&:ca... | [
"lib/cancan/rules_compressor.rb",
"spec/cancan/rule_compressor_spec.rb"
] | [] | diff --git a/spec/cancan/rule_compressor_spec.rb b/spec/cancan/rule_compressor_spec.rb
index 3f643ef2..a2e1d295 100644
--- a/spec/cancan/rule_compressor_spec.rb
+++ b/spec/cancan/rule_compressor_spec.rb
@@ -87,8 +87,7 @@ def cannot(action, subject, args = nil)
end
end
- # TODO: not supported yet
- xcontext ... | true | |
CanCanCommunity/cancancan | 779 | issue_to_patch | Update README.md | Add a hint regarding running a single file/folder. | 9c75a78b5b60d59d9620ae6ae609d76941228cca | 5d83deb8cc32f8426828edf4386b73955a9efe6a | diff --git a/README.md b/README.md
index 47a5fcc6..83243748 100644
--- a/README.md
+++ b/README.md
@@ -179,6 +179,8 @@ When first developing, you need to run `bundle install` and then `bundle exec ap
You can then run all appraisal files (like CI does), with `appraisal rake` or just run a specific set `DB='sqlite' bu... | [
"README.md"
] | [] | true | ||
CanCanCommunity/cancancan | 701 | issue_to_patch | Update adapter creation guide | @coorasse I reopened this pr as there was an issue with travis.
Should pass now | 5d5cac41151c361ca3940d0fcfa9d990bdaa09b2 | 39a71b20e0bb30e8f7814b2fc256e2bd546510ef | diff --git a/docs/model_adapter.md b/docs/model_adapter.md
index 8b529e05..45d4ade1 100644
--- a/docs/model_adapter.md
+++ b/docs/model_adapter.md
@@ -1,79 +1,140 @@
# Model Adapter
-CanCan includes a model adapter layer which allows it to change behavior depending on the model used. The current adapters are.
+CanCa... | [
"docs/model_adapter.md"
] | [
{
"comment": "@Liberatys can you point to `[ActiveRecord Base](./active_record_4_adapter_spec.rb)` for example?",
"path": "docs/Model-Adapter.md",
"hunk": "@@ -126,6 +195,27 @@ def self.matches_conditions_hash?(subject, conditions)\n end\n ```\n \n-The first one returns `true` when there's a conditions... | true | ||
CanCanCommunity/cancancan | 689 | issue_to_patch | Implement detection for sti for including subclasses in check | * Remove subclass rule inclusion for non sti classes
* Start of implementing more sti detection utilities which are going to be used in a rewrite (coming)
@coorasse how do you want to handle this ? It seems like STI will have some issues with the current implementation. I'll probably have to add conditional loading... | 7629f56a090183554a657bc4d3f63b10421ef430 | c65a9cda6f40f68f70e00f1fd8334f1204fef15b | diff --git a/lib/cancan/class_matcher.rb b/lib/cancan/class_matcher.rb
index 0bdf0fd9..65efcca3 100644
--- a/lib/cancan/class_matcher.rb
+++ b/lib/cancan/class_matcher.rb
@@ -1,3 +1,5 @@
+require_relative 'sti_detector'
+
# This class is responsible for matching classes and their subclasses as well as
# upmatching cl... | [
"lib/cancan/class_matcher.rb",
"lib/cancan/model_adapters/sti_normalizer.rb",
"lib/cancan/sti_detector.rb",
"spec/cancan/model_adapters/active_record_adapter_spec.rb"
] | [
{
"comment": "Only include the subclasses in the check if the model is an sti class",
"path": "lib/cancan/class_matcher.rb",
"hunk": "@@ -12,6 +14,8 @@ def self.matches_subject_class?(subjects, subject)\n def self.matching_class_check(subject, sub, has_subclasses)\n matches = matches_class_or_is_r... | diff --git a/spec/cancan/model_adapters/active_record_adapter_spec.rb b/spec/cancan/model_adapters/active_record_adapter_spec.rb
index 6fea7554..bb6a93dc 100644
--- a/spec/cancan/model_adapters/active_record_adapter_spec.rb
+++ b/spec/cancan/model_adapters/active_record_adapter_spec.rb
@@ -1033,6 +1033,43 @@ class Json... | true | |
CanCanCommunity/cancancan | 689 | comment_to_fix | Implement detection for sti for including subclasses in check | I think we also need the test where can'ing the child doesn't automatically can the parent to satisfy this scenario, yeah? https://github.com/CanCanCommunity/cancancan/issues/677#issuecomment-753387317
Something like...
```
u1 = User.create!(name: 'pippo')
ability = Ability.new(u1)
ability.can :manage, Child
... | 7629f56a090183554a657bc4d3f63b10421ef430 | c65a9cda6f40f68f70e00f1fd8334f1204fef15b | diff --git a/spec/cancan/model_adapters/active_record_adapter_spec.rb b/spec/cancan/model_adapters/active_record_adapter_spec.rb
index 6fea7554..bb6a93dc 100644
--- a/spec/cancan/model_adapters/active_record_adapter_spec.rb
+++ b/spec/cancan/model_adapters/active_record_adapter_spec.rb
@@ -1033,6 +1033,43 @@ class Json... | [
"spec/cancan/model_adapters/active_record_adapter_spec.rb"
] | [
{
"comment": "I think we also need the test where can'ing the child doesn't automatically can the parent to satisfy this scenario, yeah? https://github.com/CanCanCommunity/cancancan/issues/677#issuecomment-753387317\r\n\r\nSomething like...\r\n\r\n```\r\nu1 = User.create!(name: 'pippo')\r\nability = Ability.new... | true | ||
CanCanCommunity/cancancan | 474 | issue_to_patch | Adds support for rules at the attribute/method level | Allows you to add attribute-level rules, e.g.
```ruby
can :read, User, :first_name
can :read, User, :last_name
cannot :read, User, :api_key
``` | 7a144c28edf1119cb93c8ac12957056a59656d9d | 795a51c79d29fb51a858f27b069f5f96a63dd7a7 | diff --git a/Appraisals b/Appraisals
index 383d04c2..43584ed9 100644
--- a/Appraisals
+++ b/Appraisals
@@ -27,7 +27,7 @@ appraise 'activerecord_5.0.2' do
gemfile.platforms :ruby, :mswin, :mingw do
gem 'sqlite3'
- gem 'pg', '~> 0.21'
+ gem 'pg', '~> 0.18'
end
end
diff --git a/cancancan.gemspec b/ca... | [
"Appraisals",
"cancancan.gemspec",
"gemfiles/activerecord_5.0.2.gemfile",
"lib/cancan.rb",
"lib/cancan/ability.rb",
"lib/cancan/ability/rules.rb",
"lib/cancan/ability/strong_parameter_support.rb",
"lib/cancan/conditions_matcher.rb",
"lib/cancan/exceptions.rb",
"lib/cancan/parameter_validators.rb",... | [
{
"comment": "Nice one. Let's extract this into a separate PR so that we can merge it already. 👍 ",
"path": ".rubocop.yml",
"hunk": "@@ -38,7 +38,7 @@ Lint/AmbiguousBlockAssociation:\n \n \n AllCops:\n- TargetRubyVersion: 2.0\n+ TargetRubyVersion: 2.2.0",
"resolving_sha": "795a51c79d29fb51a858f27... | diff --git a/spec/cancan/ability_spec.rb b/spec/cancan/ability_spec.rb
index 1fbb047d..1e47459e 100644
--- a/spec/cancan/ability_spec.rb
+++ b/spec/cancan/ability_spec.rb
@@ -182,17 +182,23 @@
it 'lists all permissions' do
@ability.can :manage, :all
@ability.can :learn, Range
- @ability.cannot :read, St... | true | |
CanCanCommunity/cancancan | 474 | comment_to_fix | Adds support for rules at the attribute/method level | I'm not a fan of this syntax. I prefer the old-style `if...else` block. Nothing really important but just to let you know ;) | 7a144c28edf1119cb93c8ac12957056a59656d9d | 795a51c79d29fb51a858f27b069f5f96a63dd7a7 | diff --git a/lib/cancan/conditions_matcher.rb b/lib/cancan/conditions_matcher.rb
index 9c5fee15..3e7d2e73 100644
--- a/lib/cancan/conditions_matcher.rb
+++ b/lib/cancan/conditions_matcher.rb
@@ -1,10 +1,11 @@
module CanCan
module ConditionsMatcher
# Matches the block or conditions hash
- def matches_conditi... | [
"lib/cancan/conditions_matcher.rb"
] | [
{
"comment": "I'm not a fan of this syntax. I prefer the old-style `if...else` block. Nothing really important but just to let you know ;)",
"path": "lib/cancan/conditions_matcher.rb",
"hunk": "@@ -1,9 +1,12 @@\n module CanCan\n module ConditionsMatcher\n # Matches the block or conditions hash\n- ... | true | ||
CanCanCommunity/cancancan | 474 | comment_to_fix | Adds support for rules at the attribute/method level | can we add a test to see how it looks with multiple `extra_args`? | 7a144c28edf1119cb93c8ac12957056a59656d9d | 795a51c79d29fb51a858f27b069f5f96a63dd7a7 | diff --git a/spec/cancan/ability_spec.rb b/spec/cancan/ability_spec.rb
index 1fbb047d..1e47459e 100644
--- a/spec/cancan/ability_spec.rb
+++ b/spec/cancan/ability_spec.rb
@@ -182,17 +182,23 @@
it 'lists all permissions' do
@ability.can :manage, :all
@ability.can :learn, Range
- @ability.cannot :read, St... | [
"spec/cancan/ability_spec.rb"
] | [
{
"comment": "can we add a test to see how it looks with multiple `extra_args`?",
"path": "spec/cancan/ability_spec.rb",
"hunk": "@@ -275,10 +281,10 @@\n int > x\n end\n \n- expect(@ability.can?(:read, 2, 1)).to be(true)\n- expect(@ability.can?(:read, 2, 3)).to be(false)\n- expect(@ab... | true | ||
CanCanCommunity/cancancan | 474 | comment_to_fix | Adds support for rules at the attribute/method level | you can now rebase. this has been fixed already. | 7a144c28edf1119cb93c8ac12957056a59656d9d | 795a51c79d29fb51a858f27b069f5f96a63dd7a7 | diff --git a/Appraisals b/Appraisals
index 383d04c2..43584ed9 100644
--- a/Appraisals
+++ b/Appraisals
@@ -27,7 +27,7 @@ appraise 'activerecord_5.0.2' do
gemfile.platforms :ruby, :mswin, :mingw do
gem 'sqlite3'
- gem 'pg', '~> 0.21'
+ gem 'pg', '~> 0.18'
end
end
| [
"Appraisals"
] | [
{
"comment": "you can now rebase. this has been fixed already.",
"path": "Appraisals",
"hunk": "@@ -43,6 +43,6 @@ appraise 'activerecord_5.1.0' do\n \n gemfile.platforms :ruby, :mswin, :mingw do\n gem 'sqlite3'\n- gem 'pg'\n+ gem 'pg', '~> 0.18'",
"resolving_sha": "795a51c79d29fb51a858f2... | true | ||
CanCanCommunity/cancancan | 474 | comment_to_fix | Adds support for rules at the attribute/method level | you are actually taking all methods and not just attributes here, or I got it wrong? in that case it smells a little bit, what do you think? | 7a144c28edf1119cb93c8ac12957056a59656d9d | 795a51c79d29fb51a858f27b069f5f96a63dd7a7 | diff --git a/lib/cancan/ability/strong_parameter_support.rb b/lib/cancan/ability/strong_parameter_support.rb
new file mode 100644
index 00000000..bb42cf9e
--- /dev/null
+++ b/lib/cancan/ability/strong_parameter_support.rb
@@ -0,0 +1,39 @@
+module CanCan
+ module Ability
+ module StrongParameterSupport
+ # Retu... | [
"lib/cancan/ability/strong_parameter_support.rb"
] | [
{
"comment": "you are actually taking all methods and not just attributes here, or I got it wrong? in that case it smells a little bit, what do you think?",
"path": "lib/cancan/ability/strong_parameter_support.rb",
"hunk": "@@ -0,0 +1,25 @@\n+module CanCan\n+ module Ability\n+ module StrongParameter... | true | ||
CanCanCommunity/cancancan | 474 | comment_to_fix | Adds support for rules at the attribute/method level | this part could be extracted into a separate PR and immediately merged to make this PR smaller | 7a144c28edf1119cb93c8ac12957056a59656d9d | 795a51c79d29fb51a858f27b069f5f96a63dd7a7 | diff --git a/lib/cancan/rule.rb b/lib/cancan/rule.rb
index 9b3ccf79..af7b1555 100644
--- a/lib/cancan/rule.rb
+++ b/lib/cancan/rule.rb
@@ -5,25 +5,30 @@ module CanCan
# helpful methods to determine permission checking and conditions hash generation.
class Rule # :nodoc:
include ConditionsMatcher
- attr_re... | [
"lib/cancan/rule.rb"
] | [
{
"comment": "this part could be extracted into a separate PR and immediately merged to make this PR smaller",
"path": "lib/cancan/rule.rb",
"hunk": "@@ -73,12 +76,31 @@ def matches_subject?(subject)\n @subjects.include?(:all) || @subjects.include?(subject) || matches_subject_class?(subject)\n ... | true | ||
CanCanCommunity/cancancan | 474 | comment_to_fix | Adds support for rules at the attribute/method level | do you want to check all of them? `(attribute.is_a?(Array) && attribute.all? {|a| a.is_a?(Symbol) })` | 7a144c28edf1119cb93c8ac12957056a59656d9d | 795a51c79d29fb51a858f27b069f5f96a63dd7a7 | diff --git a/lib/cancan/parameter_validators.rb b/lib/cancan/parameter_validators.rb
new file mode 100644
index 00000000..546a4f1d
--- /dev/null
+++ b/lib/cancan/parameter_validators.rb
@@ -0,0 +1,7 @@
+module CanCan
+ module ParameterValidators
+ def valid_attribute_param?(attribute)
+ attribute.nil? || attri... | [
"lib/cancan/parameter_validators.rb"
] | [
{
"comment": "do you want to check all of them? `(attribute.is_a?(Array) && attribute.all? {|a| a.is_a?(Symbol) })`",
"path": "lib/cancan/parameter_validators.rb",
"hunk": "@@ -0,0 +1,7 @@\n+module CanCan\n+ module ParameterValidators\n+ def valid_attribute_param?(attribute)\n+ attribute.nil? |... | true | ||
CanCanCommunity/cancancan | 474 | comment_to_fix | Adds support for rules at the attribute/method level | wouldn't it be more performant to implement it using `Set` and `rule.base_behavior`? So, something like this:
```rb
attributes = relevant_rules(action, subject).inject(Set.new) do |set, rule|
if rule.attributes.empty? && subject < ActiveRecord::Base
attrs = subject.column_names.map(&:to_sym) - [:id]
else... | 7a144c28edf1119cb93c8ac12957056a59656d9d | 795a51c79d29fb51a858f27b069f5f96a63dd7a7 | diff --git a/lib/cancan/ability/strong_parameter_support.rb b/lib/cancan/ability/strong_parameter_support.rb
new file mode 100644
index 00000000..bb42cf9e
--- /dev/null
+++ b/lib/cancan/ability/strong_parameter_support.rb
@@ -0,0 +1,39 @@
+module CanCan
+ module Ability
+ module StrongParameterSupport
+ # Retu... | [
"lib/cancan/ability/strong_parameter_support.rb"
] | [
{
"comment": "wouldn't it be more performant to implement it using `Set` and `rule.base_behavior`? So, something like this:\r\n\r\n```rb\r\nattributes = relevant_rules(action, subject).inject(Set.new) do |set, rule|\r\n if rule.attributes.empty? && subject < ActiveRecord::Base\r\n attrs = subject.column_nam... | true | ||
CanCanCommunity/cancancan | 823 | issue_to_patch | Add Pennylane to sponsors | > $100 a month
> [...]
> We will publish your logo in the README of the project, within the "Sponsors" section.
We've been sponsoring this repo for a couple of months now. Here's our logo. | bd7158cb9f98ea581095b4149dc99f76fd9e696b | 23d689fc2b61bd7194eff9d0fd1cebe6406d8345 | diff --git a/README.md b/README.md
index 04fa2b68..a1a72ece 100644
--- a/README.md
+++ b/README.md
@@ -26,6 +26,12 @@ of models automatically and reduce duplicated code.
## Our sponsors
<br/>
+<a href="https://www.pennylane.com/" target="_blank">
+ <img src="./logo/pennylane.svg" alt="Pennylane" height="50"/>
+</a... | [
"README.md",
"logo/pennylane.svg"
] | [] | true | ||
CanCanCommunity/cancancan | 722 | issue_to_patch | New documentation | A whole refactoring of the current documentation. | 2957182474e84e79fd73b60aef05889944ece520 | 5c8883f92293e7afe468cb41aa2d687713698665 | diff --git a/README.md b/README.md
index bd5bf3ffb..526740022 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
[](https://github.com/CanCanCommunity/cancancan/actions/workflows/test.yml/badge.svg)
[![Code C... | [
"README.md",
"docs/Ability-Precedence.md",
"docs/Ability-for-Other-Users.md",
"docs/Accessing-request-data.md",
"docs/Action-Aliases.md",
"docs/Authorization-for-Namespaced-Controllers.md",
"docs/Authorizing-controller-actions.md",
"docs/Changing-Defaults.md",
"docs/Checking-Abilities.md",
"docs/C... | [
{
"comment": "Hi @coorasse meanwhile this URL is outdated, should probably be changed to:\r\nhttps://github.com/CanCanCommunity/cancancan/blob/develop/docs/define_check_abilities.md",
"path": "lib/generators/cancan/ability/templates/ability.rb",
"hunk": "@@ -26,7 +24,7 @@ def initialize(user)\n # ob... | true | ||
CanCanCommunity/cancancan | 814 | issue_to_patch | add support for polymorphic associations in active record | This PR attempts to add support for polymorphic associations in Active Record. It addresses this issue: https://github.com/CanCanCommunity/cancancan/issues/793
The solution works for the most part but there are some difficulties with making it work correctly for using the association name instead of the association ... | 7c99c593dd55127db16b0920167814a296c38e0d | dbfbd847e78fc315e5fc3da74e05f4ec84570ea6 | diff --git a/lib/cancan/conditions_matcher.rb b/lib/cancan/conditions_matcher.rb
index 009c3f6a..6c43a7e4 100644
--- a/lib/cancan/conditions_matcher.rb
+++ b/lib/cancan/conditions_matcher.rb
@@ -39,11 +39,13 @@ def matches_non_block_conditions(subject)
def nested_subject_matches_conditions?(subject_hash)
pa... | [
"lib/cancan/conditions_matcher.rb",
"lib/cancan/model_adapters/abstract_adapter.rb",
"lib/cancan/model_adapters/active_record_adapter.rb",
"spec/cancan/model_adapters/active_record_adapter_spec.rb"
] | [] | diff --git a/spec/cancan/model_adapters/active_record_adapter_spec.rb b/spec/cancan/model_adapters/active_record_adapter_spec.rb
index efb03c62..810af592 100644
--- a/spec/cancan/model_adapters/active_record_adapter_spec.rb
+++ b/spec/cancan/model_adapters/active_record_adapter_spec.rb
@@ -60,6 +60,12 @@
t.tim... | true | |
CanCanCommunity/cancancan | 815 | issue_to_patch | Renames method name in ConditionsMatcher | Renames `ConditionsMatcher#matches_hash_conditions` to `matches_hash_conditions?` to better communicate that it returns a boolean, like the other `matches_xx?` methods. | 7c99c593dd55127db16b0920167814a296c38e0d | 07ae0acde6adeaada4cb8bbe2d111e67cd10a3e1 | diff --git a/lib/cancan/conditions_matcher.rb b/lib/cancan/conditions_matcher.rb
index 009c3f6a..b72faadf 100644
--- a/lib/cancan/conditions_matcher.rb
+++ b/lib/cancan/conditions_matcher.rb
@@ -67,7 +67,7 @@ def matches_conditions_hash?(subject, conditions = @conditions)
def matches_all_conditions?(adapter, sub... | [
"lib/cancan/conditions_matcher.rb"
] | [] | true | ||
CanCanCommunity/cancancan | 817 | issue_to_patch | Fix rdoc link | "too many redirects" at rdoc.info | 7c99c593dd55127db16b0920167814a296c38e0d | 4b44926c8766fa7d6588dad71da0fe170fb20cc5 | diff --git a/README.md b/README.md
index 83243748..04fa2b68 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@
[](https://codeclimate.com/github/CanCanCommunity/cancancan)
[Developer guide](./docs/README.md) |
-[RDocs](http://rdo... | [
"README.md"
] | [] | true | ||
CanCanCommunity/cancancan | 818 | issue_to_patch | Remove puts statement | This removes a `puts` statement introduced in dcb429aef63910130811c7f212772b7fa918a926. I assume this wasn't left in intentionally?
It litters the output a bit when running tests or the app itself. | 7c99c593dd55127db16b0920167814a296c38e0d | 057d8a013b7f951fff4e57a979f9960018539255 | diff --git a/lib/cancan/conditions_matcher.rb b/lib/cancan/conditions_matcher.rb
index 009c3f6a..818dba7e 100644
--- a/lib/cancan/conditions_matcher.rb
+++ b/lib/cancan/conditions_matcher.rb
@@ -71,7 +71,6 @@ def matches_all_conditions?(adapter, subject, conditions)
elsif conditions.respond_to?(:include?)
... | [
"lib/cancan/conditions_matcher.rb"
] | [] | true | ||
CanCanCommunity/cancancan | 820 | issue_to_patch | Fix a typo in friendly_id.md | The correct path is `config/initializers/cancancan.rb` | 7c99c593dd55127db16b0920167814a296c38e0d | 30d3571f5965fca8dc4f929fee77b8b9a598b200 | diff --git a/docs/friendly_id.md b/docs/friendly_id.md
index 8f2f92a3..b20c03eb 100644
--- a/docs/friendly_id.md
+++ b/docs/friendly_id.md
@@ -4,7 +4,7 @@ If you are using [FriendlyId](https://github.com/norman/friendly_id) you will pr
You do not have to write `find_by :slug` or something like that, that is always e... | [
"docs/friendly_id.md"
] | [] | true | ||
CanCanCommunity/cancancan | 594 | issue_to_patch | Add support to translate action | This PR allows to translate an action's name in unauthorized message using ActiveSupport I18n.
| 8cc9d02111bf44ef4179f92b02085b50d08cfcea | 0610ee3308d2ae6c7a84d5cb7bce2b30b63dd1e1 | diff --git a/lib/cancan/unauthorized_message_resolver.rb b/lib/cancan/unauthorized_message_resolver.rb
index 7dfe6cf9..678772e5 100644
--- a/lib/cancan/unauthorized_message_resolver.rb
+++ b/lib/cancan/unauthorized_message_resolver.rb
@@ -4,7 +4,8 @@ module CanCan
module UnauthorizedMessageResolver
def unauthor... | [
"lib/cancan/unauthorized_message_resolver.rb",
"spec/cancan/ability_spec.rb"
] | [] | diff --git a/spec/cancan/ability_spec.rb b/spec/cancan/ability_spec.rb
index 5407de23..acc07b9e 100644
--- a/spec/cancan/ability_spec.rb
+++ b/spec/cancan/ability_spec.rb
@@ -707,6 +707,27 @@ class Account
end
end
+ it "uses action's name in i18n" do
+ class Account
+ include ActiveModel::M... | true | |
CanCanCommunity/cancancan | 702 | issue_to_patch | Support scopes of STI classes as ability conditions | This fixes a bug introduced in https://github.com/CanCanCommunity/cancancan/pull/649 that broke using scopes of STI models as conditions. Without the change the new test produces this error:
```
ArgumentError:
Unknown key: "type". Valid keys are: :includes, :eager_load, :preload, :select, :group, :order, :joins, :... | be14fdae4d14cff0a92c719b39889571093d82a5 | 82dc20fb708f1b8eb32b8d4d35f3c6ed9512d663 | diff --git a/lib/cancan/model_adapters/sti_normalizer.rb b/lib/cancan/model_adapters/sti_normalizer.rb
index 4e656f01..e6cb3142 100644
--- a/lib/cancan/model_adapters/sti_normalizer.rb
+++ b/lib/cancan/model_adapters/sti_normalizer.rb
@@ -30,8 +30,16 @@ def update_rule(subject, rule, rules_cache)
# create a ... | [
"lib/cancan/model_adapters/sti_normalizer.rb",
"spec/cancan/model_adapters/active_record_adapter_spec.rb"
] | [
{
"comment": "```suggestion\r\n sti_conditions = { subject.inheritance_column => subject.sti_name }\r\n```",
"path": "lib/cancan/model_adapters/sti_normalizer.rb",
"hunk": "@@ -30,8 +30,16 @@ def update_rule(subject, rule, rules_cache)\n \n # create a new rule for the subclasses that li... | diff --git a/spec/cancan/model_adapters/active_record_adapter_spec.rb b/spec/cancan/model_adapters/active_record_adapter_spec.rb
index 90065108..0e29248e 100644
--- a/spec/cancan/model_adapters/active_record_adapter_spec.rb
+++ b/spec/cancan/model_adapters/active_record_adapter_spec.rb
@@ -1150,6 +1150,7 @@ class Child... | true | |
CanCanCommunity/cancancan | 798 | issue_to_patch | RulesCompressor is too aggressive
`RulesCompressor` is too aggressive when there are multiple rules with different actions or subjects.
```
context 'multiple "can catch all" with different subjects' do
let(:rules) do
[can(:read, Blog),
can(:update, Blog)]
end
it 'preserves all rul... | Allow to disable rules compressor | We have some corner cases where the rules compressor does not play well with STI.
Since the rules compressor might not be needed in such cases, we want to allow disabling it.
We can now disable it globally or per-query.
This PR fixes #783 and #663.
I believe such cases can be resolved by disabling the rules com... | 8efb52207b370cc3c916bb34db1fcf6ff67832d1 | a8f75fe622e41eb1ba7920a18341fae4161ea026 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6178c6ec..5dece0e0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,7 @@
* [#653](https://github.com/CanCanCommunity/cancancan/pull/653): Add support for using an nil relation as a condition. ([@ghiculescu][])
* [#702](https://github.com/CanCanCommunity/cancanca... | [
"CHANGELOG.md",
"docs/rules_compression.md",
"lib/cancan/config.rb",
"lib/cancan/model_adapters/active_record_adapter.rb",
"spec/cancan/model_adapters/active_record_adapter_spec.rb",
"spec/spec_helper.rb"
] | [] | diff --git a/spec/cancan/model_adapters/active_record_adapter_spec.rb b/spec/cancan/model_adapters/active_record_adapter_spec.rb
index b1a76ebd..efb03c62 100644
--- a/spec/cancan/model_adapters/active_record_adapter_spec.rb
+++ b/spec/cancan/model_adapters/active_record_adapter_spec.rb
@@ -393,12 +393,26 @@ class User ... | true |
CanCanCommunity/cancancan | 653 | issue_to_patch | Support using a nil relation as a condition | I want to define an ability check that only applies if a `has_many` relation returns an empty array. The use case is I want to only allow deleting a record if it has no associated records for a given association.
In ActiveRecord you can do this with syntax like this:
> Article.joins(:comments).where(comments: { i... | 603d5e94c041e310b594fadf59c80d156fd0171d | f0fab320c2a2c853ee265a14add8ac57d0021af7 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 78fe81b5..6178c6ec 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
## Unreleased
+* [#653](https://github.com/CanCanCommunity/cancancan/pull/653): Add support for using an nil relation as a condition. ([@ghiculescu][])
* [#702](https://github.com/CanCanCom... | [
"CHANGELOG.md",
"docs/hash_of_conditions.md",
"lib/cancan/conditions_matcher.rb",
"spec/cancan/model_adapters/active_record_adapter_spec.rb"
] | [
{
"comment": "does this work also if it's defined separately?\r\n```\r\n@ability.can :read, Article, comments: { id: nil }\r\n@ability.can :read, Article, comments: { spam: false }\r\n```",
"path": "spec/cancan/model_adapters/active_record_adapter_spec.rb",
"hunk": "@@ -443,6 +443,173 @@ class User < Ac... | diff --git a/spec/cancan/model_adapters/active_record_adapter_spec.rb b/spec/cancan/model_adapters/active_record_adapter_spec.rb
index c50f18bb..b1a76ebd 100644
--- a/spec/cancan/model_adapters/active_record_adapter_spec.rb
+++ b/spec/cancan/model_adapters/active_record_adapter_spec.rb
@@ -626,6 +626,199 @@ class User ... | true | |
CanCanCommunity/cancancan | 653 | comment_to_fix | Support using a nil relation as a condition | does this work also if it's defined separately?
```
@ability.can :read, Article, comments: { id: nil }
@ability.can :read, Article, comments: { spam: false }
``` | 603d5e94c041e310b594fadf59c80d156fd0171d | f0fab320c2a2c853ee265a14add8ac57d0021af7 | diff --git a/spec/cancan/model_adapters/active_record_adapter_spec.rb b/spec/cancan/model_adapters/active_record_adapter_spec.rb
index c50f18bb..b1a76ebd 100644
--- a/spec/cancan/model_adapters/active_record_adapter_spec.rb
+++ b/spec/cancan/model_adapters/active_record_adapter_spec.rb
@@ -626,6 +626,199 @@ class User ... | [
"spec/cancan/model_adapters/active_record_adapter_spec.rb"
] | [
{
"comment": "does this work also if it's defined separately?\r\n```\r\n@ability.can :read, Article, comments: { id: nil }\r\n@ability.can :read, Article, comments: { spam: false }\r\n```",
"path": "spec/cancan/model_adapters/active_record_adapter_spec.rb",
"hunk": "@@ -443,6 +443,173 @@ class User < Ac... | true | ||
CanCanCommunity/cancancan | 653 | comment_to_fix | Support using a nil relation as a condition | I don't think that it does not allow it. it just does not return any result. right? | 603d5e94c041e310b594fadf59c80d156fd0171d | f0fab320c2a2c853ee265a14add8ac57d0021af7 | diff --git a/spec/cancan/model_adapters/active_record_adapter_spec.rb b/spec/cancan/model_adapters/active_record_adapter_spec.rb
index c50f18bb..b1a76ebd 100644
--- a/spec/cancan/model_adapters/active_record_adapter_spec.rb
+++ b/spec/cancan/model_adapters/active_record_adapter_spec.rb
@@ -626,6 +626,199 @@ class User ... | [
"spec/cancan/model_adapters/active_record_adapter_spec.rb"
] | [
{
"comment": "I don't think that it does not allow it. it just does not return any result. right?",
"path": "spec/cancan/model_adapters/active_record_adapter_spec.rb",
"hunk": "@@ -443,6 +443,173 @@ class User < ActiveRecord::Base\n expect(Article.accessible_by(ability)).to eq([article])\n end\n \... | true | ||
CanCanCommunity/cancancan | 797 | issue_to_patch | Fix most recent rubocop issues | 959eee14e132b3f5e22b9e29649327eaf46efb37 | 5aad4d8d4c06190a5fe293cfe947167fb514c2bf | diff --git a/.rubocop.yml b/.rubocop.yml
index 7456684e..8585e75c 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -6,6 +6,9 @@ Style/Documentation:
Style/NonNilCheck:
IncludeSemanticChanges: true
+Style/RedundantInitialize:
+ Enabled: false
+
Style/EmptyMethod:
Enabled: false
diff --git a/cancancan.gemspec... | [
".rubocop.yml",
"cancancan.gemspec",
"lib/cancan/ability/rules.rb",
"lib/cancan/controller_additions.rb",
"lib/cancan/model_adapters/active_record_adapter.rb",
"lib/cancan/rule.rb",
"spec/cancan/model_adapters/active_record_adapter_spec.rb"
] | [] | diff --git a/spec/cancan/model_adapters/active_record_adapter_spec.rb b/spec/cancan/model_adapters/active_record_adapter_spec.rb
index 90065108..d9e8bd40 100644
--- a/spec/cancan/model_adapters/active_record_adapter_spec.rb
+++ b/spec/cancan/model_adapters/active_record_adapter_spec.rb
@@ -277,7 +277,7 @@ class User < ... | true | ||
CanCanCommunity/cancancan | 691 | issue_to_patch | Accessible by strategy: Exists subquery | The new subquery strategy is great, but doing a "WHERE id IN (...)" can be slow, because Postgres will resolve the ID's on the right first, so if you have a big table that is going to take a lot of juice.
"WHERE EXISTS (...)" should be a lot faster, because it will already know the related ID's and only sub query th... | 682f20e0e10f193a0648c3cb8ffa89be38491f13 | 45a4416c8fe7d657f54a14cb6a7146445828aa4a | diff --git a/lib/cancan.rb b/lib/cancan.rb
index 76d72af77..c4f92c928 100644
--- a/lib/cancan.rb
+++ b/lib/cancan.rb
@@ -22,6 +22,8 @@
require 'cancan/model_adapters/active_record_4_adapter'
require 'cancan/model_adapters/active_record_5_adapter'
require 'cancan/model_adapters/strategies/base'
+ require 'canc... | [
"lib/cancan.rb",
"lib/cancan/config.rb",
"lib/cancan/model_adapters/strategies/joined_alias_each_rule_as_exists_subquery.rb",
"lib/cancan/model_adapters/strategies/joined_alias_exists_subquery.rb",
"spec/cancan/model_adapters/accessible_by_has_many_through_spec.rb",
"spec/cancan/model_adapters/has_and_bel... | [
{
"comment": "This refactor was needed to deal with Rubocop complexity offences.",
"path": "lib/cancan/model_adapters/active_record_5_adapter.rb",
"hunk": "@@ -21,17 +21,57 @@ def self.matches_condition?(subject, name, value)\n \n private\n \n+ delegate :connection, :quoted_primary_key, to: :... | diff --git a/spec/cancan/model_adapters/accessible_by_has_many_through_spec.rb b/spec/cancan/model_adapters/accessible_by_has_many_through_spec.rb
index 3f5eb2124..28cca16b5 100644
--- a/spec/cancan/model_adapters/accessible_by_has_many_through_spec.rb
+++ b/spec/cancan/model_adapters/accessible_by_has_many_through_spe... | true | |
CanCanCommunity/cancancan | 781 | issue_to_patch | Fix/lint adapter query strategies | Make the CI blue/green again :D | 9c75a78b5b60d59d9620ae6ae609d76941228cca | 7d335b9e3cdae0df1360a6426ee4a261485843c4 | diff --git a/lib/cancan/model_adapters/strategies/joined_alias_each_rule_as_exists_subquery.rb b/lib/cancan/model_adapters/strategies/joined_alias_each_rule_as_exists_subquery.rb
index 5838c7e7..b27721ad 100644
--- a/lib/cancan/model_adapters/strategies/joined_alias_each_rule_as_exists_subquery.rb
+++ b/lib/cancan/mode... | [
"lib/cancan/model_adapters/strategies/joined_alias_each_rule_as_exists_subquery.rb",
"lib/cancan/model_adapters/strategies/joined_alias_exists_subquery.rb"
] | [] | true | ||
CanCanCommunity/cancancan | 767 | issue_to_patch | Improve ability checks with nested resources (hash checks) | When we use rails nested resources, cancancan does ability checks with `can? :action, { parent => Class }`. In this case, depending on how abilities are defined, we can have bugs and unexpected behaviours. I believe these are important issues that should be solved quickly.
I created [an example application](https://... | 3d43db273b390550fa2b52fd8b39f97f3327414e | a6da6e5f47857e96275136b0776065d28f164823 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 84e8b406..56ba01a4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
Unreleased
+* [#772](https://github.com/CanCanCommunity/cancancan/pull/772): Support non-hash conditions in ability definitions. ([@Juleffel][])
* [#773](https://github.com/CanCanCommunity/... | [
"CHANGELOG.md",
"lib/cancan/conditions_matcher.rb",
"lib/cancan/model_adapters/abstract_adapter.rb",
"lib/cancan/model_adapters/active_record_adapter.rb",
"spec/cancan/ability_spec.rb",
"spec/cancan/model_adapters/active_record_adapter_spec.rb"
] | [] | diff --git a/spec/cancan/ability_spec.rb b/spec/cancan/ability_spec.rb
index 7c998fdb..8bfade06 100644
--- a/spec/cancan/ability_spec.rb
+++ b/spec/cancan/ability_spec.rb
@@ -829,4 +829,38 @@ class Account
expect(@ability.send(:rules).size).to eq(0)
end
end
+
+ describe 'when #can? is used with a Hash (... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.