generated from cfpb/open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat(validations): add validations yaml and set up repo docs #2
Merged
billhimmelsbach
merged 8 commits into
main
from
1-create-shared-data-validations-yaml-and-repo-setup
Mar 26, 2024
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
01c083e
feat(validations): add validations yaml and set up repo docs
billhimmelsbach 4b45fac
feat(manifest): add the barest minimum package.json as a test
billhimmelsbach 72cf5d5
fix(validations): lei examples and regex, references, comments
billhimmelsbach 20256f3
chore(validations): move into src folder
billhimmelsbach 24edc4a
feat(validations): add error_text field
billhimmelsbach 55e8ca1
fix(validations): fix typo in lei description
billhimmelsbach 3076e9b
fix(validations): update readme, add a missing references, add newlin…
billhimmelsbach c351244
fix(references): remove references when null
billhimmelsbach File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,8 @@ | ||
All notable changes to this project will be documented in this file. | ||
We follow the [Semantic Versioning 2.0.0](http://semver.org/) format. | ||
|
||
|
||
## x.y.z - YYYY-MM-DD | ||
## 1.0.0 - 2024-03-21 | ||
|
||
### Added | ||
- Lorem ipsum dolor sit amet | ||
|
||
### Deprecated | ||
- Nothing. | ||
|
||
### Removed | ||
- Nothing. | ||
|
||
### Fixed | ||
- Nothing. | ||
- Initial release of validations.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,106 +1,64 @@ | ||
#### CFPB Open Source Project Template Instructions | ||
# regtech-regex | ||
|
||
1. Create a new project. | ||
2. [Copy these files into the new project](#installation) | ||
3. Update the README, replacing the contents below as prescribed. | ||
4. Add any libraries, assets, or hard dependencies whose source code will be included | ||
in the project's repository to the _Exceptions_ section in the [TERMS](TERMS.md). | ||
- If no exceptions are needed, remove that section from TERMS. | ||
5. If working with an existing code base, answer the questions on the [open source checklist](opensource-checklist.md) | ||
6. Delete these instructions and everything up to the _Project Title_ from the README. | ||
7. Write some great software and tell people about it. | ||
Shared data validations using regular expressions for use at the CFPB. This repo aims to collect sensible regex data validations in one YAML file for use across multiple tech stacks in the Small Business Lending project and maybe beyond. | ||
|
||
> Keep the README fresh! It's the first thing people see and will make the initial impression. | ||
|
||
## Installation | ||
|
||
To install all of the template files, run the following script from the root of your project's directory: | ||
|
||
``` | ||
bash -c "$(curl -s https://raw.githubusercontent.com/CFPB/development/main/open-source-template.sh)" | ||
``` | ||
|
||
---- | ||
|
||
# Project Title | ||
|
||
**Description**: Put a meaningful, short, plain-language description of what | ||
this project is trying to accomplish and why it matters. | ||
Describe the problem(s) this project solves. | ||
Describe how this software can improve the lives of its audience. | ||
|
||
Other things to include: | ||
|
||
- **Technology stack**: Indicate the technological nature of the software, including primary programming language(s) and whether the software is intended as standalone or as a module in a framework or other ecosystem. | ||
- **Status**: Alpha, Beta, 1.1, etc. It's OK to write a sentence, too. The goal is to let interested people know where this project is at. This is also a good place to link to the [CHANGELOG](CHANGELOG.md). | ||
- **Links to production or demo instances** | ||
- Describe what sets this apart from related-projects. Linking to another doc or page is OK if this can't be expressed in a sentence or two. | ||
|
||
|
||
**Screenshot**: If the software has visual components, place a screenshot after the description; e.g., | ||
|
||
![](https://raw.githubusercontent.com/cfpb/open-source-project-template/main/screenshot.png) | ||
This YAML file is subject to sudden and breaking changes while the Small Business Lending project is in development, so use at your own risk. | ||
|
||
![A rough diagram of the regtech-regex vision of a single YAML file sharing the same regular expression for validating data such as Research, Statistics, Supervision, Discount IDs across multiple use cases. The diagram shows a YAML object that contains a RSSD ID number along with a regex that ensures that the value is an integer. Two arrows point from the YAML: one arrow points to a file that has an RSSD ID that is 9999 with a green validation check mark, and the other arrow points toward a file that has an RSSD ID with a red invalid symbol of X](regtech-regex.svg) | ||
|
||
## Dependencies | ||
|
||
Describe any dependencies that must be installed for this software to work. | ||
This includes programming languages, databases or other storage mechanisms, build tools, frameworks, and so forth. | ||
If specific versions of other software are required, or known not to work, call that out. | ||
This repo doesn't currently have any dependencies. Just a good old YAML file. | ||
|
||
## Installation | ||
|
||
Detailed instructions on how to install, configure, and get the project running. | ||
This should be frequently tested to ensure reliability. Alternatively, link to | ||
a separate [INSTALL](INSTALL.md) document. | ||
|
||
## Configuration | ||
|
||
If the software is configurable, describe it in detail, either here or in other documentation to which you link. | ||
Import the `validations.yaml` file using the URL or via a package manager. | ||
|
||
## Usage | ||
|
||
Show users how to use the software. | ||
Be specific. | ||
Use appropriate formatting when showing code snippets. | ||
|
||
## How to test the software | ||
Here's an example of an entry in the `validations.yaml` file: | ||
|
||
```yaml | ||
rssd_id: | ||
description: must be an integer | ||
error_text: Must be a number. | ||
examples: | ||
- '9999' | ||
- '1' | ||
link: https://regex101.com/r/l3SyQi/3 | ||
references: | ||
regex: ^\d+$ | ||
``` | ||
|
||
If the software includes automated tests, detail how to run those tests. | ||
Each entry should be snake case, with common acronyms and initialisms being acceptable. | ||
|
||
## Known issues | ||
Each entry should have the following properties: | ||
|
||
Document any known significant shortcomings with the software. | ||
- description: a short description of how this value should be validated | ||
- error_text: a user-friendly message that could be displayed on a frontend form validation | ||
- examples: an array of strings that are examples of values that would be validated as being correct | ||
- link: a link to [regex101.com](https://regex101.com/) for live documentation and so devs can easily test the regular expression | ||
- references: an array of links to external documentation | ||
- regex: the regular expression that validates the value | ||
|
||
## Getting help | ||
|
||
Instruct users how to get help with this software; this might include links to an issue tracker, wiki, mailing list, etc. | ||
|
||
**Example** | ||
|
||
If you have questions, concerns, bug reports, etc, please file an issue in this repository's Issue Tracker. | ||
|
||
## Getting involved | ||
|
||
This section should detail why people should get involved and describe key areas you are | ||
currently focusing on; e.g., trying to get feedback on features, fixing certain bugs, building | ||
important pieces, etc. | ||
|
||
General instructions on _how_ to contribute should be stated with a link to [CONTRIBUTING](CONTRIBUTING.md). | ||
Think you might have a simple regular expression that relates to consumer finance that might be helpful? Create an issue! See [CONTRIBUTING](CONTRIBUTING.md) for more details. | ||
|
||
|
||
---- | ||
--- | ||
|
||
## Open source licensing info | ||
|
||
1. [TERMS](TERMS.md) | ||
2. [LICENSE](LICENSE) | ||
3. [CFPB Source Code Policy](https://github.com/cfpb/source-code-policy/) | ||
|
||
|
||
---- | ||
--- | ||
|
||
## Credits and references | ||
|
||
1. Projects that inspired you | ||
2. Related projects | ||
3. Books, papers, talks, or other sources that have meaningful impact or influence on this project | ||
1. Screenshot uses icons from the [CFPB Design System](https://cfpb.github.io/design-system/foundation/iconography) and composed with [tldraw](https://www.tldraw.com/) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "regtech-regex", | ||
"license": "MIT", | ||
"private": true, | ||
"version": "1.0.0" | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't realize an empty value was a valid null in YAML, though I do see in the spec that it's valid. It does feel weird, though. You normally just don't include a given attribute if it is null, though you do occasionally see explicit
NULL
s. I also just leard~
is also null in YAMLese. 🤷Anyway, my vote would be to just exclude
references
for a given entry if we don't have any references for it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to have some kind of linter/checklist someday to check to make sure people don't forget fields, so that was my thought behind the null values.
Happy to just exclude it though, so put up a commit for it.