diff --git a/.gitignore b/.gitignore index 5bd2ddd..723fd78 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ .env cmd/tui/shutter cmd/shutter/shutter +go.work +go.work.sum diff --git a/__snapshots__/combined_ignore_and_scrub.snap b/__snapshots__/combined_ignore_and_scrub.snap deleted file mode 100644 index 0c69f41..0000000 --- a/__snapshots__/combined_ignore_and_scrub.snap +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: Combined Ignore and Scrub -test_name: TestCombinedIgnoreAndScrub -file_name: ignore_test.go -version: 0.1.0 ---- -{ - "created_at": "", - "email": "", - "ip_address": "", - "name": "John Doe", - "user_id": "" -} \ No newline at end of file diff --git a/__snapshots__/complex_nested_structure.snap b/__snapshots__/complex_nested_structure.snap deleted file mode 100644 index 9e987b6..0000000 --- a/__snapshots__/complex_nested_structure.snap +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: Complex Nested Structure -test_name: TestComplexNestedStructure -file_name: shutter_test.go -version: 0.1.0 ---- -shutter_test.Post{ - ID: 100, - Title: "Introduction to Go Snapshot Testing", - Content: "This is a comprehensive guide to snapshot testing in Go...", - Author: shutter_test.User{ - ID: 1, - Username: "john_doe", - Email: "john@example.com", - Active: true, - CreatedAt: time.Time{ - wall: 0x0, - ext: 63809375400, - loc: (*time.Location)(nil), - }, - Roles: []string{"admin", "moderator", "user"}, - Metadata: map[string]interface{}{ - "language": "en", - "notifications": true, - "preferences": map[string]interface{}{ - "email_frequency": "weekly", - "notifications": true, - }, - "theme": "dark", - }, - }, - Tags: []string{"go", "testing", "snapshots", "best-practices"}, - Comments: []shutter_test.Comment{ - { - ID: 1, - Author: "alice", - Content: "Great post!", - CreatedAt: time.Time{ - wall: 0x0, - ext: 63810858120, - loc: (*time.Location)(nil), - }, - Replies: []shutter_test.Comment{ - { - ID: 2, - Author: "bob", - Content: "I agree!", - CreatedAt: time.Time{ - wall: 0x0, - ext: 63810863100, - loc: (*time.Location)(nil), - }, - Replies: []shutter_test.Comment{ - }, - }, - }, - }, - { - ID: 3, - Author: "charlie", - Content: "Thanks for sharing!", - CreatedAt: time.Time{ - wall: 0x0, - ext: 63810927000, - loc: (*time.Location)(nil), - }, - Replies: []shutter_test.Comment{ - }, - }, - }, - Likes: 42, - Published: true, - CreatedAt: time.Time{ - wall: 0x0, - ext: 63809802000, - loc: (*time.Location)(nil), - }, -} diff --git a/__snapshots__/custom_ignore_function.snap b/__snapshots__/custom_ignore_function.snap deleted file mode 100644 index 6b58384..0000000 --- a/__snapshots__/custom_ignore_function.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Custom Ignore Function -test_name: TestCustomIgnore -file_name: ignore_test.go -version: 0.1.0 ---- -{ - "grade": "A", - "name": "John Doe" -} \ No newline at end of file diff --git a/__snapshots__/custom_regex_scrubber.snap b/__snapshots__/custom_regex_scrubber.snap deleted file mode 100644 index e1cde1f..0000000 --- a/__snapshots__/custom_regex_scrubber.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Custom Regex Scrubber -test_name: TestCustomScrubbers/regex_scrubber -file_name: scrubbers_test.go -version: 0.1.0 ---- -{ - "api_key": "", - "name": "Test User", - "secret_key": "" -} \ No newline at end of file diff --git a/__snapshots__/custom_scrubber.snap b/__snapshots__/custom_scrubber.snap deleted file mode 100644 index 0cb2c55..0000000 --- a/__snapshots__/custom_scrubber.snap +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: Custom Scrubber -test_name: TestCustomScrubbers/custom_function_scrubber -file_name: scrubbers_test.go -version: 0.1.0 ---- -hello world! this is a test. \ No newline at end of file diff --git a/__snapshots__/custom_type_test.snap b/__snapshots__/custom_type_test.snap deleted file mode 100644 index 74b1774..0000000 --- a/__snapshots__/custom_type_test.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Custom Type Test -test_name: TestSnapCustomType -file_name: shutter_test.go -version: 0.1.0 ---- -shutter_test.CustomStruct{ - Name: "Alice", - Age: 30, -} diff --git a/__snapshots__/exact_match_scrubber.snap b/__snapshots__/exact_match_scrubber.snap deleted file mode 100644 index 288c262..0000000 --- a/__snapshots__/exact_match_scrubber.snap +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: Exact Match Scrubber -test_name: TestCustomScrubbers/exact_match_scrubber -file_name: scrubbers_test.go -version: 0.1.0 ---- -The secret password is '' and should be hidden. \ No newline at end of file diff --git a/__snapshots__/ignore_empty_values.snap b/__snapshots__/ignore_empty_values.snap deleted file mode 100644 index ec59716..0000000 --- a/__snapshots__/ignore_empty_values.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Ignore Empty Values -test_name: TestIgnoreValues/empty_values -file_name: ignore_test.go -version: 0.1.0 ---- -{ - "email": "john@example.com", - "name": "John Doe" -} \ No newline at end of file diff --git a/__snapshots__/ignore_in_arrays.snap b/__snapshots__/ignore_in_arrays.snap deleted file mode 100644 index 963399e..0000000 --- a/__snapshots__/ignore_in_arrays.snap +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: Ignore in Arrays -test_name: TestIgnoreKeys/arrays -file_name: ignore_test.go -version: 0.1.0 ---- -{ - "users": [ - { - "email": "alice@example.com", - "id": 1, - "name": "Alice" - }, - { - "email": "bob@example.com", - "id": 2, - "name": "Bob" - } - ] -} \ No newline at end of file diff --git a/__snapshots__/ignore_key_pattern.snap b/__snapshots__/ignore_key_pattern.snap deleted file mode 100644 index dd7235e..0000000 --- a/__snapshots__/ignore_key_pattern.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Ignore Key Pattern -test_name: TestIgnoreKeyPatterns/contains_pattern -file_name: ignore_test.go -version: 0.1.0 ---- -{ - "email": "john@example.com", - "username": "john_doe" -} \ No newline at end of file diff --git a/__snapshots__/ignore_keys_matching_pattern.snap b/__snapshots__/ignore_keys_matching_pattern.snap deleted file mode 100644 index 9cfcff5..0000000 --- a/__snapshots__/ignore_keys_matching_pattern.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Ignore Keys Matching Pattern -test_name: TestIgnoreKeyPatterns/prefix_pattern -file_name: ignore_test.go -version: 0.1.0 ---- -{ - "product_id": 100, - "product_name": "Widget" -} \ No newline at end of file diff --git a/__snapshots__/ignore_multiple_keys.snap b/__snapshots__/ignore_multiple_keys.snap deleted file mode 100644 index 65b7e94..0000000 --- a/__snapshots__/ignore_multiple_keys.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Ignore Multiple Keys -test_name: TestIgnoreKeys/multiple_keys -file_name: ignore_test.go -version: 0.1.0 ---- -{ - "email": "john@example.com", - "id": 1, - "name": "John Doe" -} \ No newline at end of file diff --git a/__snapshots__/ignore_null_values.snap b/__snapshots__/ignore_null_values.snap deleted file mode 100644 index f1b4356..0000000 --- a/__snapshots__/ignore_null_values.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Ignore Null Values -test_name: TestIgnoreValues/null_values -file_name: ignore_test.go -version: 0.1.0 ---- -{ - "age": 30, - "email": "john@example.com", - "name": "John Doe" -} \ No newline at end of file diff --git a/__snapshots__/ignore_password_field.snap b/__snapshots__/ignore_password_field.snap deleted file mode 100644 index dcf47ce..0000000 --- a/__snapshots__/ignore_password_field.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Ignore Password Field -test_name: TestIgnoreKeys/key_value_pairs -file_name: ignore_test.go -version: 0.1.0 ---- -{ - "email": "john@example.com", - "username": "john_doe" -} \ No newline at end of file diff --git a/__snapshots__/ignore_sensitive_keys.snap b/__snapshots__/ignore_sensitive_keys.snap deleted file mode 100644 index e8d1e3e..0000000 --- a/__snapshots__/ignore_sensitive_keys.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Ignore Sensitive Keys -test_name: TestIgnoreSensitiveKeys -file_name: ignore_test.go -version: 0.1.0 ---- -{ - "email": "john@example.com", - "name": "John Doe", - "username": "john_doe" -} \ No newline at end of file diff --git a/__snapshots__/ignore_specific_values.snap b/__snapshots__/ignore_specific_values.snap deleted file mode 100644 index 595b8f2..0000000 --- a/__snapshots__/ignore_specific_values.snap +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Ignore Specific Values -test_name: TestIgnoreValues/specific_values -file_name: ignore_test.go -version: 0.1.0 ---- -{ - "message": "Processing" -} \ No newline at end of file diff --git a/__snapshots__/json_with_special_characters.snap b/__snapshots__/json_with_special_characters.snap deleted file mode 100644 index 81b2d05..0000000 --- a/__snapshots__/json_with_special_characters.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: JSON with Special Characters -test_name: TestJsonWithSpecialCharacters -file_name: shutter_test.go -version: 0.1.0 ---- -map[string]interface{}{ - "backslash": "path\\to\\file", - "emoji": "πŸ˜€ πŸ˜ƒ πŸ˜„ 😁 πŸ˜†", - "english": "Hello, World!", - "escaped": "quotes: \"double\" and 'single'", - "newlines": "line1\nline2\rline3\r\nline4", - "special_chars": "!@#$%^&*()_+-=[]{}|;:,.<>?", - "tabs": "col1\tcol2\tcol3", - "unicode": "こんにけは δΈ–η•Œ 🌍", -} diff --git a/__snapshots__/large_json_structure.snap b/__snapshots__/large_json_structure.snap deleted file mode 100644 index 1792ff4..0000000 --- a/__snapshots__/large_json_structure.snap +++ /dev/null @@ -1,54 +0,0 @@ ---- -title: Large JSON Structure -test_name: TestLargeJson -file_name: shutter_test.go -version: 0.1.0 ---- -map[string]interface{}{ - "created_at": "2023-01-28T14:30:00Z", - "customer_id": 42.0, - "delivered_at": nil, - "id": 1001.0, - "products": []interface{}{ - map[string]interface{}{ - "description": "High-performance laptop", - "id": 1.0, - "in_stock": true, - "name": "Laptop", - "price": 999.99, - "stock": 5.0, - "tags": []interface{}{ - "electronics", - "computers", - "laptops", - }, - }, - map[string]interface{}{ - "description": "Wireless mouse", - "id": 2.0, - "in_stock": true, - "name": "Mouse", - "price": 29.99, - "stock": 50.0, - "tags": []interface{}{ - "electronics", - "accessories", - }, - }, - map[string]interface{}{ - "description": "Mechanical keyboard", - "id": 3.0, - "in_stock": false, - "name": "Keyboard", - "price": 149.99, - "stock": 0.0, - "tags": []interface{}{ - "electronics", - "accessories", - }, - }, - }, - "shipped_at": "2023-02-01T10:00:00Z", - "status": "shipped", - "total": 1179.97, -} diff --git a/__snapshots__/multiple_complex_structures.snap b/__snapshots__/multiple_complex_structures.snap deleted file mode 100644 index 78bb61b..0000000 --- a/__snapshots__/multiple_complex_structures.snap +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: Multiple Complex Structures -test_name: TestMultipleComplexStructures -file_name: shutter_test.go -version: 0.1.0 ---- -[]shutter_test.User{ - { - ID: 1, - Username: "alice", - Email: "alice@example.com", - Active: true, - CreatedAt: time.Time{ - wall: 0x0, - ext: 0, - loc: (*time.Location)(nil), - }, - Roles: []string{"user", "moderator"}, - Metadata: map[string]interface{}{ - "badge": "verified", - "verified": true, - }, - }, - { - ID: 2, - Username: "bob", - Email: "bob@example.com", - Active: false, - CreatedAt: time.Time{ - wall: 0x0, - ext: 0, - loc: (*time.Location)(nil), - }, - Roles: []string{"user"}, - Metadata: map[string]interface{}{ - "avatar": "https://example.com/bob.jpg", - "verified": false, - }, - }, - { - ID: 3, - Username: "charlie", - Email: "charlie@example.com", - Active: true, - CreatedAt: time.Time{ - wall: 0x0, - ext: 0, - loc: (*time.Location)(nil), - }, - Roles: []string{"user", "admin"}, - Metadata: map[string]interface{}{ - "account_age_days": 365, - "verified": true, - }, - }, -} diff --git a/__snapshots__/multiple_scrubbers.snap b/__snapshots__/multiple_scrubbers.snap deleted file mode 100644 index fb10ace..0000000 --- a/__snapshots__/multiple_scrubbers.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: Multiple Scrubbers -test_name: TestBuiltInScrubbers -file_name: scrubbers_test.go -version: 0.1.0 ---- -{ - "api_key": "", - "backup_card": "", - "backup_email": "", - "birth_date": "", - "card_number": "", - "client_ip": "", - "created_at": "", - "email": "", - "jwt_token": "", - "message": "Connection from ", - "name": "John Doe", - "server_ip": "", - "session_id": "", - "stripe_key": "", - "unix_created": , - "unix_updated": , - "updated_at": "", - "us_format_date": "", - "user_id": "" -} \ No newline at end of file diff --git a/__snapshots__/multiple_values_test.snap b/__snapshots__/multiple_values_test.snap deleted file mode 100644 index 3dcdde8..0000000 --- a/__snapshots__/multiple_values_test.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: Multiple Values Test -test_name: TestSnapMultiple -file_name: shutter_test.go -version: 0.1.0 ---- -"value1" -"value2" -42 -"foo" -"bar" -"baz" -"wibble" -"wobble" -"tock" -interface{}(nil) diff --git a/__snapshots__/nested_ignore_patterns.snap b/__snapshots__/nested_ignore_patterns.snap deleted file mode 100644 index ab257ec..0000000 --- a/__snapshots__/nested_ignore_patterns.snap +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: Nested Ignore Patterns -test_name: TestNestedIgnorePatterns -file_name: ignore_test.go -version: 0.1.0 ---- -{ - "admin": {}, - "user": { - "email": "john@example.com", - "id": 1, - "name": "John Doe", - "profile": { - "bio": "Developer", - "website": "https://example.com" - } - } -} \ No newline at end of file diff --git a/__snapshots__/nested_maps_and_slices.snap b/__snapshots__/nested_maps_and_slices.snap deleted file mode 100644 index 8a36c69..0000000 --- a/__snapshots__/nested_maps_and_slices.snap +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: Nested Maps and Slices -test_name: TestNestedMapsAndSlices -file_name: shutter_test.go -version: 0.1.0 ---- -map[string]interface{}{ - "posts": map[string]interface{}{ - "categories": []string{"tech", "lifestyle", "news"}, - "drafts": 5, - "published": 42, - }, - "stats": map[string]interface{}{ - "daily": map[string]interface{}{ - "clicks": 320, - "conversions": map[string]interface{}{ - "by_source": map[string]int{ - "organic": 25, - "paid": 15, - "referral": 5, - }, - "total": 45, - }, - "views": 1500, - }, - }, - "users": map[string]interface{}{ - "active": []map[string]interface{}{ - { - "id": 1, - "name": "Alice", - "verified": true, - }, - { - "id": 2, - "name": "Bob", - "verified": false, - }, - }, - "inactive": []map[string]interface{}{ - { - "id": 3, - "name": "Charlie", - }, - }, - }, -} diff --git a/__snapshots__/real_world_api_response.snap b/__snapshots__/real_world_api_response.snap deleted file mode 100644 index b0a9a86..0000000 --- a/__snapshots__/real_world_api_response.snap +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: Real World API Response -test_name: TestComplexRealWorldExample -file_name: ignore_test.go -version: 0.1.0 ---- -{ - "metadata": { - "server_ip": "", - "session_token": "", - "user_agent": "Mozilla/5.0" - }, - "request_id": "", - "timestamp": "", - "transaction": { - "amount": 99.99, - "currency": "USD", - "id": "txn_abc123", - "timestamp": "" - }, - "user": { - "created_at": "", - "email": "", - "id": "", - "ip_address": "", - "name": "John Doe" - } -} \ No newline at end of file diff --git a/__snapshots__/scrub_with_snap.snap b/__snapshots__/scrub_with_snap.snap deleted file mode 100644 index 12c2baf..0000000 --- a/__snapshots__/scrub_with_snap.snap +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: Scrub With Snap -test_name: TestScrubWithSnapFunction -file_name: scrubbers_test.go -version: 0.1.0 ---- -map[string]interface{}{ - "created_at": "", - "email": "", - "name": "John Doe", - "user_id": "", -} diff --git a/__snapshots__/scrubbed_api_keys.snap b/__snapshots__/scrubbed_api_keys.snap deleted file mode 100644 index 2f782f7..0000000 --- a/__snapshots__/scrubbed_api_keys.snap +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: Scrubbed API Keys -test_name: TestIndividualScrubbers/api_keys -file_name: scrubbers_test.go -version: 0.1.0 ---- -{ - "api_key_prod": "", - "name": "Test Config", - "stripe_key": "", - "test_key": "" -} \ No newline at end of file diff --git a/__snapshots__/scrubbed_credit_cards.snap b/__snapshots__/scrubbed_credit_cards.snap deleted file mode 100644 index 1af7960..0000000 --- a/__snapshots__/scrubbed_credit_cards.snap +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: Scrubbed Credit Cards -test_name: TestIndividualScrubbers/credit_cards -file_name: scrubbers_test.go -version: 0.1.0 ---- -{ - "another_card": "", - "backup_card": "", - "card_number": "", - "name": "John Doe" -} \ No newline at end of file diff --git a/__snapshots__/scrubbed_dates.snap b/__snapshots__/scrubbed_dates.snap deleted file mode 100644 index 65309a8..0000000 --- a/__snapshots__/scrubbed_dates.snap +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: Scrubbed Dates -test_name: TestIndividualScrubbers/dates -file_name: scrubbers_test.go -version: 0.1.0 ---- -{ - "birth_date": "", - "hire_date": "", - "name": "John Doe", - "us_format": "" -} \ No newline at end of file diff --git a/__snapshots__/scrubbed_emails.snap b/__snapshots__/scrubbed_emails.snap deleted file mode 100644 index 615f455..0000000 --- a/__snapshots__/scrubbed_emails.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Scrubbed Emails -test_name: TestIndividualScrubbers/emails -file_name: scrubbers_test.go -version: 0.1.0 ---- -{ - "backup_email": "", - "email": "", - "name": "John Doe" -} \ No newline at end of file diff --git a/__snapshots__/scrubbed_ips.snap b/__snapshots__/scrubbed_ips.snap deleted file mode 100644 index 07201ea..0000000 --- a/__snapshots__/scrubbed_ips.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Scrubbed IPs -test_name: TestIndividualScrubbers/ip_addresses -file_name: scrubbers_test.go -version: 0.1.0 ---- -{ - "client_ip": "", - "message": "Connection from ", - "server_ip": "" -} \ No newline at end of file diff --git a/__snapshots__/scrubbed_jwts.snap b/__snapshots__/scrubbed_jwts.snap deleted file mode 100644 index 9f1005a..0000000 --- a/__snapshots__/scrubbed_jwts.snap +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Scrubbed JWTs -test_name: TestIndividualScrubbers/jwts -file_name: scrubbers_test.go -version: 0.1.0 ---- -{ - "refresh_token": "", - "token": "" -} \ No newline at end of file diff --git a/__snapshots__/scrubbed_timestamps.snap b/__snapshots__/scrubbed_timestamps.snap deleted file mode 100644 index 89e5ec8..0000000 --- a/__snapshots__/scrubbed_timestamps.snap +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: Scrubbed Timestamps -test_name: TestIndividualScrubbers/timestamps -file_name: scrubbers_test.go -version: 0.1.0 ---- -{ - "created_at": "", - "deleted_at": "", - "name": "Test Event", - "updated_at": "" -} \ No newline at end of file diff --git a/__snapshots__/scrubbed_unix_timestamps.snap b/__snapshots__/scrubbed_unix_timestamps.snap deleted file mode 100644 index 9d09d27..0000000 --- a/__snapshots__/scrubbed_unix_timestamps.snap +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: Scrubbed Unix Timestamps -test_name: TestIndividualScrubbers/unix_timestamps -file_name: scrubbers_test.go -version: 0.1.0 ---- -{ - "created": , - "deleted": , - "name": "Test Event", - "updated": -} \ No newline at end of file diff --git a/__snapshots__/scrubbed_uuids.snap b/__snapshots__/scrubbed_uuids.snap deleted file mode 100644 index dd57c64..0000000 --- a/__snapshots__/scrubbed_uuids.snap +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Scrubbed UUIDs -test_name: TestIndividualScrubbers/uuid -file_name: scrubbers_test.go -version: 0.1.0 ---- -{ - "name": "John Doe", - "session_id": "", - "user_id": "" -} \ No newline at end of file diff --git a/__snapshots__/snapjson_complex_api_response.snap b/__snapshots__/snapjson_complex_api_response.snap deleted file mode 100644 index f032d71..0000000 --- a/__snapshots__/snapjson_complex_api_response.snap +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: SnapJSON Complex API Response -test_name: TestSnapJsonComplexAPI -file_name: shutter_test.go -version: 0.1.0 ---- -{ - "code": 200, - "data": { - "pagination": { - "page": 1, - "per_page": 10, - "total": 3, - "total_pages": 1 - }, - "users": [ - { - "active": true, - "department": "Engineering", - "id": 1, - "name": "Alice", - "role": "admin" - }, - { - "active": true, - "department": "Sales", - "id": 2, - "name": "Bob", - "role": "user" - }, - { - "active": false, - "department": "Marketing", - "id": 3, - "name": "Charlie", - "role": "user" - } - ] - }, - "status": "success", - "timestamp": "2023-11-18T21:45:30Z" -} \ No newline at end of file diff --git a/__snapshots__/snapjson_mixed_types.snap b/__snapshots__/snapjson_mixed_types.snap deleted file mode 100644 index 522cc49..0000000 --- a/__snapshots__/snapjson_mixed_types.snap +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: SnapJSON Mixed Types -test_name: TestSnapJsonMixedTypes -file_name: shutter_test.go -version: 0.1.0 ---- -{ - "complex": [ - { - "id": 1, - "type": "user" - }, - { - "id": 100, - "type": "post" - }, - [ - 1, - 2, - 3 - ], - "string", - null - ], - "mixed_array": [ - "string", - 123, - 45.67, - true, - false, - null, - { - "nested": "object" - }, - [ - 1, - 2, - 3 - ] - ] -} \ No newline at end of file diff --git a/__snapshots__/snapjson_nested_objects.snap b/__snapshots__/snapjson_nested_objects.snap deleted file mode 100644 index 5460b3b..0000000 --- a/__snapshots__/snapjson_nested_objects.snap +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: SnapJSON Nested Objects -test_name: TestSnapJsonWithNestedObjects -file_name: shutter_test.go -version: 0.1.0 ---- -{ - "created_at": "2023-06-15T10:30:00Z", - "user": { - "id": 42, - "permissions": [ - "read", - "write", - "admin" - ], - "profile": { - "avatar": "https://example.com/avatar.jpg", - "settings": { - "language": "en", - "notifications": true, - "theme": "dark" - }, - "username": "jane_smith" - } - } -} \ No newline at end of file diff --git a/__snapshots__/snapjson_real_world_example.snap b/__snapshots__/snapjson_real_world_example.snap deleted file mode 100644 index 27d3ea6..0000000 --- a/__snapshots__/snapjson_real_world_example.snap +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: SnapJSON Real World Example -test_name: TestSnapJsonRealWorldExample -file_name: shutter_test.go -version: 0.1.0 ---- -{ - "data": { - "product": { - "description": "High-quality wireless headphones with noise cancellation", - "id": "prod_12345", - "inventory": { - "available": 425, - "damaged": 25, - "reserved": 50, - "total": 500 - }, - "name": "Premium Wireless Headphones", - "price": { - "amount": 199.99, - "currency": "USD", - "discount": 10, - "final_price": 179.99 - }, - "ratings": { - "average": 4.5, - "breakdown": { - "1": 20, - "2": 30, - "3": 100, - "4": 350, - "5": 750 - }, - "count": 1250 - }, - "reviews": [ - { - "content": "Great sound quality and comfortable to wear.", - "created_at": "2023-11-15T10:30:00Z", - "helpful": 25, - "id": "rev_001", - "rating": 5, - "title": "Excellent product!", - "user": "john_doe" - }, - { - "content": "Works well, could be cheaper.", - "created_at": "2023-11-10T14:20:00Z", - "helpful": 12, - "id": "rev_002", - "rating": 4, - "title": "Good but pricey", - "user": "jane_smith" - } - ], - "sku": "PWH-001", - "specifications": { - "battery_life": "30 hours", - "colors": [ - "black", - "white", - "blue" - ], - "warranty_months": 24, - "weight": "250g" - } - }, - "related_products": [ - { - "id": "prod_12346", - "name": "Headphone Case", - "price": 29.99 - }, - { - "id": "prod_12347", - "name": "Audio Cable", - "price": 14.99 - } - ] - }, - "request_id": "req_abc123def456", - "success": true, - "timestamp": "2023-11-18T22:00:00Z" -} \ No newline at end of file diff --git a/__snapshots__/structure_with_empty_values.snap b/__snapshots__/structure_with_empty_values.snap deleted file mode 100644 index 073af35..0000000 --- a/__snapshots__/structure_with_empty_values.snap +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: Structure with Empty Values -test_name: TestStructureWithEmptyValues -file_name: shutter_test.go -version: 0.1.0 ---- -[]shutter_test.Container{ - { - Items: []string{ - }, - Tags: map[string]string{ - }, - OptionalID: (*int)(nil), - Count: 0, - Active: false, - }, - { - Items: []string(nil), - Tags: map[string]string(nil), - OptionalID: (*int)(nil), - Count: 0, - Active: true, - }, - { - Items: []string{"a", "b", "c"}, - Tags: map[string]string{ - "env": "dev", - "type": "test", - }, - OptionalID: &int(42), - Count: 3, - Active: true, - }, -} diff --git a/__snapshots__/structure_with_interface_fields.snap b/__snapshots__/structure_with_interface_fields.snap deleted file mode 100644 index 16127b3..0000000 --- a/__snapshots__/structure_with_interface_fields.snap +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: Structure with Interface Fields -test_name: TestStructureWithInterface -file_name: shutter_test.go -version: 0.1.0 ---- -[]shutter_test.Response{ - { - Status: "success", - Message: "User retrieved", - Data: shutter_test.User{ - ID: 1, - Username: "john", - Email: "john@example.com", - Active: true, - CreatedAt: time.Time{ - wall: 0x0, - ext: 0, - loc: (*time.Location)(nil), - }, - Roles: []string(nil), - Metadata: map[string]interface{}(nil), - }, - Meta: map[string]interface{}{ - "request_id": "req-123", - "timestamp": "2023-01-20T10:30:00Z", - }, - }, - { - Status: "error", - Message: "User not found", - Data: nil, - Meta: map[string]interface{}{ - "error_code": 404, - "error_type": "NOT_FOUND", - }, - }, - { - Status: "success", - Message: "Posts retrieved", - Data: []shutter_test.Post{ - { - ID: 1, - Title: "First Post", - Content: "", - Author: shutter_test.User{ - ID: 0, - Username: "", - Email: "", - Active: false, - CreatedAt: time.Time{ - wall: 0x0, - ext: 0, - loc: (*time.Location)(nil), - }, - Roles: []string(nil), - Metadata: map[string]interface{}(nil), - }, - Tags: []string(nil), - Comments: []shutter_test.Comment(nil), - Likes: 0, - Published: true, - CreatedAt: time.Time{ - wall: 0x0, - ext: 0, - loc: (*time.Location)(nil), - }, - }, - }, - Meta: map[string]interface{}{ - "page": 1, - "per_page": 20, - "total_count": 10, - }, - }, -} diff --git a/__snapshots__/structure_with_pointers.snap b/__snapshots__/structure_with_pointers.snap deleted file mode 100644 index 1c015de..0000000 --- a/__snapshots__/structure_with_pointers.snap +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: Structure with Pointers -test_name: TestStructureWithPointers -file_name: shutter_test.go -version: 0.1.0 ---- -shutter_test.Person{ - Name: "John", - Age: 35, - Address: &shutter_test.Address{ - Street: "123 Main St", - City: "Boston", - Zip: "02101", - }, - Manager: &shutter_test.Person{ - Name: "Jane", - Age: 30, - Address: (*shutter_test.Address)(), - Manager: (*shutter_test.Person)(nil), - Friends: []*shutter_test.Person(nil), - Email: &string("jane@example.com"), - }, - Friends: []*shutter_test.Person{ - (*shutter_test.Person)(), - }, - Email: (*string)(nil), -} diff --git a/scripts/version.sh b/scripts/version.sh index 880214a..e17dbc2 100755 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -80,7 +80,10 @@ echo "" if [[ $REPLY =~ ^[Yy]$ ]]; then jj tag set "$NEW_VERSION" "cmd/shutter/$NEW_VERSION" - jj git push --tags + # jj git push doesn't support tags, so export to git and push via git + jj git export + GIT_DIR=$(jj git root) + git --git-dir="$GIT_DIR" push origin "$NEW_VERSION" "cmd/shutter/$NEW_VERSION" echo "Done. Tagged and pushed $NEW_VERSION" else echo "Aborted."