Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Do not process a type if it is ignored #73

Merged
merged 3 commits into from
Mar 18, 2024
Merged

Do not process a type if it is ignored #73

merged 3 commits into from
Mar 18, 2024

Conversation

barkbay
Copy link
Contributor

@barkbay barkbay commented Mar 18, 2024

Do not process a type if it's excluded.

Copy link
Contributor

@thbkrkr thbkrkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for fixing this. Indeed, as processType is a recursive method, by removing shouldIgnoreType, we stopped ignoring certain types.

Now you fixed ignored types, this:

ignoreTypes:
- "Embedded[0-9]$"

is applied.

So, we should update test expected rendered files.

go run main.go --source-path=test --output-path=test/expected.md  --config=test/config.yaml --renderer=markdown
go run main.go --source-path=test --output-path=test/expected.asciidoc  --config=test/config.yaml --renderer=asciidoctor

But before that, I think we want to keep to render inlined Embedded structs. We could then test ignoreTypes with another type:

Suggestion:

diff --git a/test/config.yaml b/test/config.yaml
index b7a0f7b..419b4eb 100644
--- a/test/config.yaml
+++ b/test/config.yaml
@@ -2,9 +2,8 @@ processor:
   ignoreGroupVersions:
     - "GVK"
   ignoreTypes:
-    - "Embedded[0-9]$"
+    - "Status$"
   ignoreFields:
-    - "status$"
     - "TypeMeta$"

processor/processor.go Outdated Show resolved Hide resolved
@barkbay
Copy link
Contributor Author

barkbay commented Mar 18, 2024

But before that, I think we want to keep to render inlined Embedded structs. We could then test ignoreTypes with another type:

In order to keep testing the inline feature I updated the ignoreTypes with the following:

  ignoreTypes:
    - "Embedded[2-4]$"

Let me know if this also matches what you have in mind.

@barkbay barkbay marked this pull request as ready for review March 18, 2024 14:36
@barkbay barkbay requested a review from thbkrkr March 18, 2024 14:38
@barkbay barkbay merged commit f3a2725 into master Mar 18, 2024
3 checks passed
@barkbay barkbay deleted the fix-ignore-types branch March 18, 2024 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants