Skip to content

🚀 Feature: Rule options #20

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Feature Request Checklist

Overview

Lint rules often need to be configured. For example, in pr-linked-issue, requiring a configurable list of labels on the linked issue. OctoGuide will need to allow:

  1. Defining a schema of options on a rule
  2. Allowing repos to define values for options as with: options

Both the action and CLI will need to read from that file, including fetching it.

Additional Info

I'm envisioning the end user config experience will be like:

jobs:
  octoguide:
    if: ${{ !endsWith(github.actor, '[bot]') }}
    runs-on: ubuntu-latest
    steps:
      - uses: JoshuaKGoldberg/[email protected]
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          rules:
               my-rule:
                    option: true

Rules would then have an options field in their about that's set to an object of Zod schemas:

export const myRule = {
	about: {
		config: "strict",
		// ...
		options: {
			"some-option": z.string().optional()
		},
	},
	// ...
} satisfies Rule;

~Blocked on #19 - implementing an action in the first place.~  

🗺 

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: accepting prsPlease, send a pull request to resolve this! 🙏type: featureNew enhancement or request 🚀

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions