Skip to content

Comments

Feature/marie/plat 419 create policy validator cli#966

Draft
marie-x wants to merge 8 commits intodevelopfrom
feature/marie/PLAT-419_create_policy_validator_cli
Draft

Feature/marie/plat 419 create policy validator cli#966
marie-x wants to merge 8 commits intodevelopfrom
feature/marie/PLAT-419_create_policy_validator_cli

Conversation

@marie-x
Copy link

@marie-x marie-x commented Mar 24, 2022

📚 Purpose

Create a policy validation CLI for doing schema validation and semantic linting

👌 Resolves:

  • ✨ PLAT-418

📦 Impacts:

packages/mds-policy-linter

✅ PR Checklist

  • need moar test data
  • need tests
  • need to be able to publish a self-contained executable

@changeset-bot
Copy link

changeset-bot bot commented Mar 24, 2022

⚠️ No Changeset found

Latest commit: e4a4d67

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

@mdurling mdurling left a comment

Choose a reason for hiding this comment

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

A few nits to get you started with. Looking good tho.

"license": "Apache-2.0",
"author": "Marie Maxham",
"main": "dist/index.js",
"types": "dist/index.d.ts",

Choose a reason for hiding this comment

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

You planning to add the /bin folder in this PR or is that subsequent?

"@mds-core/mds-policy-service": "workspace:0.11.26",
"@mds-core/mds-types": "workspace:0.9.2",
"@mds-core/mds-utils": "workspace:0.5.0",
"ajv": "8.10.0",

Choose a reason for hiding this comment

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

I think this is an advanced version of ajv compared to what we're currently using elsewhere in this repo.

* limitations under the License.
*/

import { PolicyDomainCreateModel, validatePolicyDomainModel } from '@mds-core/mds-policy-service'

Choose a reason for hiding this comment

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

Looks like we need to get your ESLint/Prettier working correctly. This check failure should have been automatically fixed.

Comment on lines +47 to +49
function plural(n: number, s: string): string {
return '' + n + ' ' + (n === 1 ? s.replace(/ies$/, 'y').replace(/s$/, '') : s)
}

Choose a reason for hiding this comment

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

There's a very similar function already in @mds-core/mds-utils ... pluralize(n, 'policy', 'policies') is how it would be used.

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.

2 participants