Skip to content

Commit

Permalink
feat(validations): add validations yaml and set up repo docs
Browse files Browse the repository at this point in the history
Sets up the `regtech-regex` repository with an initial validations file, sets up the Readme, and cleans up the boilerplate files. Gets this repo ready to become public! 🥳

## Changes

- add first version of validations.yaml
  - email
  - lei
  - rssd_id
  - simple_us_phone_number
  - tin
- cleans up issue/pr templates with only parts relevant to the repo
- updates the changelog for the initial version
- added a basic `package.json` (making this a real [NPM package in the future](#4) may be helpful
- updates the `CONTRIBUTING.md` file to not include browser support information
- removes unnecessary `INSTALL.md` file
- creates the Readme file with examples, documentation, and usage instructions

## Notes

Here's the completed open source checklist with `~` next to ones that aren't applicable:
- [x] **Has PII been removed?**
  - Use [Clouseau](https://github.com/virtix/clouseau) for scanning source code.
  - If there are images, visually inspect each image to ensure there is no CFPB-specific information.
- [x] **Have security vulnerabilities been remediated?**
- [x] **Are we including any other open source products? If so, is there any conflict with our public domain release?**
- [x] **Is our `TERMS.md` included?**
- [x] **Is a `CHANGELOG.md` present and does it contain structured, consistently formatted recent history?**
- [x] **Are instructions for contributing included (`CONTRIBUTING.md`)?**
- [x] **Are installation instructions clearly written in the `README` _and_ tested on a clean machine?**
- [x] **Are all dependencies described in the `README`, `requirements.txt`, and/or `buildout.cfg`?**
- [~] **Are the API docs generated?**
- [~] **Are there unit tests?**
- [~] **If applicable and possible, is it set up in TravisCI?**
- [x] **Have multiple people reviewed the code?**
- [x] **Is there a screenshot in the `README`, if applicable?**

## Todos

**post-mvp wishlist**
- #3
- #4
- #5
- #6

## Checklist

- [x] PR has an informative and human-readable title
- [x] Changes are limited to a single goal (no scope creep)
- [x] Code can be automatically merged (no conflicts)
- [x] Passes all existing automated tests
- [x] Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
- [x] Reviewers requested
  • Loading branch information
billhimmelsbach committed Mar 26, 2024
2 parents 07ac45f + c351244 commit c4f1aae
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 231 deletions.
12 changes: 0 additions & 12 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,4 @@ Short description explaining the high-level reason for the new issue.

## Current behavior


## Expected behavior


## Steps to replicate behavior (include URLs)

1.


## Screenshots



43 changes: 1 addition & 42 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
[Short description explaining the high-level reason for the pull request]

## Additions

-

## Removals

-

## Changes

-

## Testing

1.

## Screenshots


## Notes

-
Expand All @@ -32,36 +17,10 @@
- [ ] PR has an informative and human-readable title
- [ ] Changes are limited to a single goal (no scope creep)
- [ ] Code can be automatically merged (no conflicts)
- [ ] Code follows the standards laid out in the [development playbook](https://github.com/cfpb/development)
- [ ] Passes all existing automated tests
- [ ] Any _change_ in functionality is tested
- [ ] New functions are documented (with a description, list of inputs, and expected output)
- [ ] Placeholder code is flagged / future todos are captured in comments
- [ ] Visually tested in supported browsers and devices (see checklist below :point_down:)
- [ ] Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
- [ ] Reviewers requested with the [Reviewers tool](https://help.github.com/articles/requesting-a-pull-request-review/) :arrow_right:
- [ ] Reviewers requested

## Testing checklist

### Browsers

- [ ] Chrome
- [ ] Firefox
- [ ] Safari
- [ ] Internet Explorer 8, 9, 10, and 11
- [ ] Edge
- [ ] iOS Safari
- [ ] Chrome for Android

### Accessibility

- [ ] Keyboard friendly
- [ ] Screen reader friendly

### Other

- [ ] Is useable without CSS
- [ ] Is useable without JS
- [ ] Flexible from small to large screens
- [ ] No linting errors or warnings
- [ ] JavaScript tests are passing
13 changes: 2 additions & 11 deletions CHANGELOG.md
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
18 changes: 2 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
> feature request, you are agreeing to comply with this waiver of copyright interest.
> Details can be found in our [TERMS](TERMS.md) and [LICENSE](LICENSE).

There are two primary ways to help:
- Using the issue tracker, and
- Changing the code-base.

- Using the issue tracker, and
- Changing the code-base.

## Using the issue tracker

Expand All @@ -21,7 +20,6 @@ Use the issue tracker to find ways to contribute. Find a bug or a feature, menti
the issue that you will take on that effort, then follow the _Changing the code-base_
guidance below.


## Changing the code-base

Generally speaking, you should fork this repository, make changes in your
Expand All @@ -30,15 +28,3 @@ unit tests that validate implemented features and the presence or lack of defect
Additionally, the code should follow any stylistic and architectural guidelines
prescribed by the project. In the absence of such guidelines, mimic the styles
and patterns in the existing code-base.


## Browser support

We configure our build chain tools
(typically [Autoprefixer](https://github.com/postcss/autoprefixer)
and [Babel](https://babeljs.io))
to support a reasonable set of backward compatibility with older browsers.

Please read up on
[our current browser support guidance](https://github.com/cfpb/development/blob/main/guides/browser-support.md)
and follow it when contributing to this project.
3 changes: 0 additions & 3 deletions INSTALL.md

This file was deleted.

106 changes: 32 additions & 74 deletions README.md
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/)
73 changes: 0 additions & 73 deletions opensource-checklist.md

This file was deleted.

6 changes: 6 additions & 0 deletions package.json
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"
}
10 changes: 10 additions & 0 deletions regtech-regex.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c4f1aae

Please sign in to comment.