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

Add required macros check #215

Merged
merged 7 commits into from
Jan 29, 2025

Conversation

McGwire-Jones
Copy link
Contributor

@McGwire-Jones McGwire-Jones commented Jan 28, 2025

Issue

Link any related issue(s) in this section.

Intent

This PR is meant to add a new option that allows the user to enforce required macro options.

Implementation

A new file based rule hasRequiredMacroOptions has been added that checks the options a macro is defined with to look for the options listed in requiredMacroOptions.

The LintConfig has been updated to check for hasRequiredMacroOptions and if it is set to true to read a list of strings from requiredMacroOptions.

The readMe has been updated to mention this new option and its default values.

Checks

  • [] Code is formatted correctly (npm run lint:fix).
  • [] Any new functionality has been unit tested.
  • [] All unit tests are passing (npm test).
  • [] All CI checks are green.
  • [] sasjslint-schema.json is updated with any new / changed functionality
  • [] JSDoc comments have been added or updated.
  • Reviewer is assigned.

@allanbowe
Copy link
Member

@McGwire-Jones - many thanks for this! I'll ask one of our developers to review it. In the meantime, would you mind expanding the README section to include an example, to help others who may try to use the feature?

@YuryShkoda YuryShkoda self-requested a review January 29, 2025 05:35
Copy link
Member

@YuryShkoda YuryShkoda left a comment

Choose a reason for hiding this comment

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

Hi @McGwire-Jones,
Thanks for your contribution!
Your PR looks great in general, but a few minor tweaks are required.

src/rules/file/hasRequiredMacroOptions.spec.ts Outdated Show resolved Hide resolved
src/rules/file/hasRequiredMacroOptions.spec.ts Outdated Show resolved Hide resolved
src/rules/file/hasRequiredMacroOptions.spec.ts Outdated Show resolved Hide resolved
src/rules/file/hasRequiredMacroOptions.spec.ts Outdated Show resolved Hide resolved
src/rules/file/hasRequiredMacroOptions.spec.ts Outdated Show resolved Hide resolved
src/rules/file/hasRequiredMacroOptions.spec.ts Outdated Show resolved Hide resolved
src/rules/file/hasRequiredMacroOptions.spec.ts Outdated Show resolved Hide resolved
src/rules/file/hasRequiredMacroOptions.spec.ts Outdated Show resolved Hide resolved
src/rules/file/hasRequiredMacroOptions.ts Outdated Show resolved Hide resolved
@McGwire-Jones
Copy link
Contributor Author

Hi @McGwire-Jones, Thanks for your contribution! Your PR looks great in general, but a few minor tweaks are required.

Than you @YuryShkoda for the feedback! I've made the changes you requested.

@allanbowe
Copy link
Member

allanbowe commented Jan 29, 2025

Failing on the lint check - can you please run npx prettier --write "{src,test}/**/*.{ts,tsx,js,jsx,html,css,sass,less,json,yml,md,graphql}" ?

EDIT- you addressed in the meantime, thanks

@allanbowe allanbowe dismissed YuryShkoda’s stale review January 29, 2025 16:30

issues addressed

@allanbowe allanbowe merged commit eb7f70e into sasjs:main Jan 29, 2025
1 check passed
@allanbowe
Copy link
Member

so this got released to NPM: https://www.npmjs.com/package/@sasjs/lint

But not github, due to expired token. looking into it

@allanbowe
Copy link
Member

@all-contributors please add @McGwire-Jones for code

Copy link
Contributor

@allanbowe

I've put up a pull request to add @McGwire-Jones! 🎉

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.

3 participants