dotnet / dotnet/docfx

[Feature Request] Allow filtering for access modifier

Open
#10,252 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.4k
Forks
890
Avg merge
2h 9m
Merged PRs (30d)
11

Description

**Is your feature request related to a problem? Please describe.**
I have `includePrivateMembers` enabled since I need `private methods`. But I need to hide `private fields`.

**Describe the solution you'd like**
Allow filtering in a filter config like this:
```yaml
apiRules:
- exclude:
uidRegex: .*
accessModifier: private
type: Field
```

**Describe alternatives you've considered**
Disabling `includePrivateMembers` is not possible since I need the methods. The only alternative I was able to come up with is creating an attribute and marking every single private field with it.

Another workaround that works in my case is applying the filter like this (but relying on the naming scheme):
```yaml
apiRules:
- exclude:
uidRegex: \._[^\.]*$
type: Field
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.