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

Allow overriding config parameters without writing a config file #405

Closed
strayer opened this issue Sep 9, 2024 · 2 comments
Closed

Allow overriding config parameters without writing a config file #405

strayer opened this issue Sep 9, 2024 · 2 comments
Labels
question Further information is requested

Comments

@strayer
Copy link

strayer commented Sep 9, 2024

I'd like to run the SARIF formatter on our CI but don't want to configure it by default for everyone running the linter itself on their development machines. I know I can create a config, extend the original config in it and override it with the --config parameter, but that requires all repositories using our shared pipeline to have the same markdownlint-cli2 config file name.

Instead I'd like to be able to configure a formatter as a CLI parameter or being able to override the base config and let markdownlint-cli2 resolve the repo config on its own. Ideally the configuration in the repository should be set up for developers to allow easy onboarding.

Not sure how this could work with the current configuration/CLI setup, so I don't really have a helpful suggestion, just my feature request. Feel free to just close this if it isn't in scope for the project or not helpful.

@DavidAnson
Copy link
Owner

If I understand your scenario correctly, you should be able to have your pipeline make the relevant configuration file update to add the SARIF output formatter. While that will create a diff for the repository during the CI run, it will be deleted as soon as it's done anyway. Or you could revert the change in your pipeline after linting.

@DavidAnson DavidAnson added the question Further information is requested label Sep 9, 2024
@DavidAnson
Copy link
Owner

Another option is to use JavaScript for the configuration file and then determine at runtime whether or not to include the SARIF formatter based on whether code was running in the context of CI or not.

@DavidAnson DavidAnson closed this as not planned Won't fix, can't repro, duplicate, stale Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants