We'd love to accept your patches and contributions to this project.
- You are welcome to submit an issue with a bug report or a feature request.
- If you are reporting a bug, please indicate which version of the package you are using and provide steps to reproduce the problem.
- If you are submitting a feature request, please indicate if you are willing or able to submit a PR for it.
To build and test the project locally, clone the repo and issue the following commands
npm install
npm test- Use feature branches for development.
- PRs for new features should target the main branch.
The input file for the test/example/example.test.js is taken from the
aep/general/example.oas.yaml from the aep.dev repository. Do not modify
this file directly in this repository. When a linting rule detects issues in
examples/example.oas.yaml:
- Confirm the issue is a true positive - Verify the detected issue is a real violation of the AEP specification.
- Fix the issue upstream - Open an issue in the aep.dev repository describing the problem in the canonical example file.
- Sync the updated file - After the problem is corrected in the aep.dev
repository, copy the updated
aep/general/example.oas.yamltoexamples/example.oas.yamlin this repository. This ensures the example file remains synchronized with the official AEP documentation and avoids divergence between repositories.
When you add a new rule there are a number of places you should consider including:
spectral.yamlshould define the new rule, possibly pointing to a new function used by the rule.functionsdirectory to hold any new function for the rule.test\<rulename>.test.jsshould test at least the error and no-error cases of the rule.
Please adhere to the following conventions for code submitted to this project:
- Rules in the
spectral.yamlruleset file should start with "aep-" and be in alphabetical order. - Functions and tests should follow the Google JavaScript Style Guide.
- When a rule is a custom function, the function name should be the rule name minus the "aep-" prefix.
- Rule severity:
- A rule for a MUST guideline in the AEPs or the OpenAPI specification
should be
severity: error - A rule for a SHOULD guideline in the AEPs or the OpenAPI specification
should be
severity: warn - Other rules may be either
severity: warnorseverity: info - Do not use
severity: hintas it is not supported in the VSCode extension
- A rule for a MUST guideline in the AEPs or the OpenAPI specification
should be
Please use the following checklist to minimize the PR review churn.
- Tests are included for any new rules
- All tests are passing
- Code coverage is > 80% for all custom functions
- Run
npm run lintandnpm run lint:fixif necessary to ensure code style
This project's code of conduct can be found in the CODE_OF_CONDUCT.md file (v1.4.0 of the CoC).
Contributions to this project must be accompanied by a Contributor License Agreement. You (or your employer) retain the copyright to your contribution, this simply gives us permission to use and redistribute your contributions as part of the project. Head over to https://cla.developers.google.com/ to see your current agreements on file or to sign a new one.
You generally only need to submit a CLA once, so if you have already submitted one (even if it was for a different project), you probably do not need to do it again.
All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult GitHub Help for more information on using pull requests.