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

[SPN-1495] Require new custom team-name tag in public API documentation #128

Merged

Conversation

bknutson123
Copy link
Collaborator

No description provided.

@bknutson123 bknutson123 requested review from jongardiner and a team as code owners January 30, 2025 18:12
@jongardiner
Copy link
Contributor

Isn't this BambooHR specific?

@bknutson123 bknutson123 requested a review from jlesueur February 5, 2025 23:40
$hasDescription = $hasDescription ?: $this->hasDescription($arg);
$hasTeamName = $hasTeamName ?: $this->hasTeamName($arg);
Copy link
Member

Choose a reason for hiding this comment

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

one approach would be to make the check prepared for a configuration. Basically, how would you write this code if you had to accept:

[
  'required-attributes' => ['prefix' => 'x', 'name' => 'team-name']
]

And then that's hard coded in this check for now, but is possible to put in sa.json in the future?

Copy link
Contributor

Choose a reason for hiding this comment

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

That type of configurability is exactly what I have in mind. My specific issue is that I really don't like have hard coded "team-name" stuff in the open source application. It's not a standard attribute. But if I could specify custom attributes that I wanted to see in the config file, then I'd be fine with a check that could report when a required attribute was missing.

The one additional thing I"d say, is I'd kind of like the configurability to have a some kind of isolation between configs for various checks. One scenario I've considered , but I don't think I've ever folded in, is an "options" subkey under the "emit" object. The added value there is you could allow the other "emit" configs to make it so that a particular option is only passed for certain files.

Copy link
Member

@jlesueur jlesueur left a comment

Choose a reason for hiding this comment

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

I'm approving with the caveat:

  1. this rule currently is specific to BambooHR
  2. the contract (the error being emitted) is not specific to BambooHR
  3. the path in the future to handle this won't change the error that is emitted, but will change how the rule is implemented.
  4. This could be built as a plugin, but the path forward there requires a lot of duplication.

@bknutson123 bknutson123 merged commit 878a832 into master Feb 6, 2025
2 checks passed
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.

4 participants