Skip to content

Commit

Permalink
Issue 105: Configure and run black and other pre-commit hooks (clea…
Browse files Browse the repository at this point in the history
…n branch) (#1962)

* Configure and run `black` and other pre-commit hooks

Co-authored-by: matt bowen <matthew.r.bowen@omb.eop.gov>
  • Loading branch information
lucasmbrown-usds and mattbowen-usds authored Oct 4, 2022
1 parent baa34ec commit 6e6223c
Show file tree
Hide file tree
Showing 162 changed files with 702 additions and 588 deletions.
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
* @esfoobar-usds @vim-usds @emma-nechamkin @mattbowen-usds

20 changes: 10 additions & 10 deletions .github/ISSUE_TEMPLATE/dataset_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ body:
id: other-datasource-type
attributes:
label: If "other" above, please specify
description: If you have selected "other" above, please give as much detail as you can as to where this data can live
description: If you have selected "other" above, please give as much detail as you can as to where this data can live
placeholder: www.example.com and www.example2.com
validations:
required: false
Expand Down Expand Up @@ -110,14 +110,14 @@ body:
attributes:
label: Known data quality issues
description: Please describe any data quality issues you know about with this dataset.
placeholder: Limited accuracy in rural areas, etc.
placeholder: Limited accuracy in rural areas, etc.
validations:
required: false
required: false
- type: input
id: geographic-coverage
attributes:
label: What is the geographic coverage (in percent) of this dataset
description: If known, provide an estimate of the coverage of this dataset vis-a-vis the full United States
description: If known, provide an estimate of the coverage of this dataset vis-a-vis the full United States
placeholder: 90%
validations:
required: false
Expand All @@ -126,9 +126,9 @@ body:
attributes:
label: Description of geographic coverage estimate
description: (If relevant) Please explain your reasoning behind the above estimate of geographic coverage
placeholder: e.g. Missing information for Puerto Rico, etc.
placeholder: e.g. Missing information for Puerto Rico, etc.
validations:
required: false
required: false
- type: input
id: last-updated-date
attributes:
Expand All @@ -151,10 +151,10 @@ body:
id: link-to-documentation
attributes:
label: Link to more documentation
description: Please provide a link where one can find additional information
description: Please provide a link where one can find additional information
placeholder: www.example.com
validations:
required: true
required: true
- type: dropdown
id: can-go-in-cloud
attributes:
Expand All @@ -167,8 +167,8 @@ body:
- type: textarea
id: additional-information
attributes:
label: Additional Information
label: Additional Information
description: Please provide any additional information you have about this dataset
placeholder: e.g. Missing information for Puerto Rico, etc.
placeholder: e.g. Missing information for Puerto Rico, etc.
validations:
required: false
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ Fixes # (issue number)
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
- [ ] Any dependent changes have been merged and published in downstream modules
6 changes: 3 additions & 3 deletions .github/workflows/deploy_be_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ jobs:
with:
# Deploy to S3 for the Staging URL
message: |
** Score Deployed! **
Find it here:
** Score Deployed! **
Find it here:
- Score Full usa.csv: https://justice40-data.s3.amazonaws.com/data-pipeline-staging/${{env.PR_NUMBER}}/${{env.SHA_NUMBER}}/data/score/csv/full/usa.csv
- Download Zip Packet: https://justice40-data.s3.amazonaws.com/data-pipeline-staging/${{env.PR_NUMBER}}/${{env.SHA_NUMBER}}/data/score/downloadable/Screening_Tool_Data.zip
repo-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
with:
# Deploy to S3 for the staging URL
message: |
** Map Deployed! **
** Map Deployed! **
Map with Staging Backend: https://screeningtool.geoplatform.gov/en?flags=stage_hash=${{env.PR_NUMBER}}/${{env.SHA_NUMBER}}
Find tiles here: https://justice40-data.s3.amazonaws.com/data-pipeline-staging/${{env.PR_NUMBER}}/${{env.SHA_NUMBER}}/data/score/tiles
repo-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy_fe_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
with:
# Deploy to S3 for the staging URL
message: |
**🚢 Here is the frontend staging link: 🚢**
**🚢 Here is the frontend staging link: 🚢**
Find it here: http://usds-geoplatform-justice40-website.s3-website-us-east-1.amazonaws.com/justice40-tool/${{env.DESTINATION_FOLDER}}/en/ !
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: "github-actions[bot]" # The user.login for temporary GitHub tokens
Expand All @@ -108,9 +108,9 @@ jobs:
uses: mshick/add-pr-comment@v1
with:
message: |
** 👋 Attention translators!! 👋 **
** 👋 Attention translators!! 👋 **
Copy changes have resulted in a new en.json file. Please download en.json file and send to translators: https://github.com/usds/justice40-tool/blob/${{env.COMMIT_HASH}}/client/src/intl/en.json
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: "github-actions[bot]" # The user.login for temporary GitHub tokens
allow-repeats: true
if: contains(steps.changed-files.outputs.modified_files, 'client/src/intl/en.json')
if: contains(steps.changed-files.outputs.modified_files, 'client/src/intl/en.json')
4 changes: 2 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
schedule:
# runs tests every day at 12am ET (4am UTC):
- cron: '0 4 * * *'
jobs:
jobs:
nightly:
runs-on: ubuntu-20.04
env:
Expand All @@ -25,4 +25,4 @@ jobs:
start: npm start
wait-on: 'http://localhost:8000'
# To run only specific spec/tests:
# spec: cypress/e2e/downloadPacket.spec.js
# spec: cypress/e2e/downloadPacket.spec.js
2 changes: 1 addition & 1 deletion .github/workflows/generate-census.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Generate Census
on:
on:
workflow_dispatch:
inputs:
confirm-action:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
description: 'Log level'
required: true
default: 'warning'
tags:
description: 'Ping test'
description: 'Ping test'
jobs:
sitePingCheck:
name: Slack Notification
Expand Down
1 change: 0 additions & 1 deletion CODE_OF_CONDUCT-es.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ Los mantenedores del proyecto tienen el derecho y la obligación de eliminar, ed
Los casos de abuso, acoso o de otro comportamiento inaceptable se pueden denunciar abriendo un problema o contactando con uno o más de los mantenedores del proyecto en justice40open@usds.gov.

Este Código de conducta es una adaptación de la versión 1.0.0 del Convenio del colaborador ([Contributor Covenant](http://contributor-covenant.org), *en inglés*) disponible en el sitio http://contributor-covenant.org/version/1/0/0/ *(en inglés)*.

2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ Project maintainers have the right and responsibility to remove, edit, or reject

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers at justice40open@usds.gov.

This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
2 changes: 1 addition & 1 deletion COMMUNITY_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ When participating in Justice40 open source community conversations and spaces,
- Take space and give space. We strive to create an equitable environment in which all are welcome and able to participate. We hope individuals feel comfortable voicing their opinions and providing contributions and will do our best to recognize and make space for individuals who may be struggling to find space here. Likewise, we expect individuals to recognize when they are taking up significant space and take a step back to allow room for others.
- Be present when joining synchronous conversations such as our community chat. Why be here if you're not going to _be here_?
- Be respectful.
- Default to positive. Assume others' contributions are legitimate and valuable and that they are made with good intention.
- Default to positive. Assume others' contributions are legitimate and valuable and that they are made with good intention.
1 change: 0 additions & 1 deletion CONTRIBUTING-es.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,3 @@ Si desea colaborar con alguna parte del código base, bifurque el repositorio si
* Al menos un revisor autorizado debe aprobar la confirmación (en [CODEOWNERS](https://github.com/usds/justice40-tool/tree/main/.github/CODEOWNERS), en inglés, consulte la lista más reciente de estos revisores).
* Todas las verificaciones de estado obligatorias deben ser aprobadas.
Si hay un desacuerdo importante entre los integrantes del equipo, se organizará una reunión con el fin de determinar el plan de acción para la solicitud de incorporación de cambios.

4 changes: 2 additions & 2 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Homebrew is an easy way to manage software downloads on MacOS. You don't _have_

You should regularly run `brew update` and `brew doctor` to make sure your packages are up to date and in good condition.

### Install Node using NVM
### Install Node using NVM

This will work for both MacOS and Win10. Follow instructions on this [link](https://medium.com/@nodesource/installing-node-js-tutorial-using-nvm-5c6ff5925dd8). Be sure to read through the whole doc to find the sections within each step relevant to you (e.g. if you're using Homebrew, when you get to Step 2 look for the section, "Install NVM with Homebrew").

Expand All @@ -54,7 +54,7 @@ You should then be able to switch to that version of node by:

To validate you are using node 14, type:

`node -v`
`node -v`

This should return *Now using node 14.x.x (npm v6.x.x)*

Expand Down
1 change: 0 additions & 1 deletion LICENSE-es.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ Por estos u otros propósitos y motivos, y sin ninguna expectativa de otra consi
c. El Afirmante excluye la responsabilidad de los derechos de compensación de otras personas que se puedan aplicar a la Obra o a cualquier uso de esta, incluidos, entre otros, los Derechos de Autor y Derechos Conexos de cualquier persona sobre la Obra. Además, el Afirmante excluye la responsabilidad de obtener los consentimientos o permisos u otros derechos necesarios que se exijan para cualquier uso de la Obra.

d. El Afirmante entiende y reconoce que Creative Commons no es una parte en este documento y que no tiene ningún derecho u obligación con respecto a esta CC0 o al uso de la Obra.

4 changes: 2 additions & 2 deletions README-es.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![CC0 License](https://img.shields.io/badge/license-CCO--1.0-brightgreen)](https://github.com/usds/justice40-tool/blob/main/LICENSE.md)

*[Read this in English!](README.md)*

Le damos la bienvenida a la comunidad de código abierto de Justice40. Este repositorio contiene el código, los procesos y la documentación que activa los datos y la tecnología de la Herramienta Justice40 para la Vigilancia del Clima y la Justicia Económica (CEJST, por sus siglas en inglés).

## Antecedentes
Expand Down Expand Up @@ -36,7 +36,7 @@ El equipo central usa el grupo para publicar la información más reciente sobre
Las colaboraciones son siempre bien recibidas. Nos agradan las aportaciones en forma de conversación sobre los temas de este repositorio y las solicitudes para incorporación de cambios en la documentación y el código.
En [CONTRIBUTING-es.md](CONTRIBUTING-es.md), consulte la manera de empezar a participar.

## Instalación
## Instalación

La instalación es una instalación típica de gatsby y los detalles se pueden encontrar en [INSTALLATION-es.md](INSTALLATION-es.md)

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,35 @@ The Justice40 initiative and screening tool were announced in an [Executive Orde
Please see our [Open Source Community Orientation](docs/Justice40_Open_Source_Community_Orientation.pptx) deck for more information on the Justice40 initiative, our team, this project, and ways to participate.

## Core team
The core Justice40 team building this tool is a small group of designers, developers, and product managers from the US Digital Service in partnership with the Council on Environmental Quality (CEQ).
The core Justice40 team building this tool is a small group of designers, developers, and product managers from the US Digital Service in partnership with the Council on Environmental Quality (CEQ).

An up-to-date list of core team members can be found in [MAINTAINERS.md](MAINTAINERS.md). The engineering members of the core team who maintain the code in this repo are listed in [.github/CODEOWNERS](.github/CODEOWNERS).

## Community
The Justice40 team is taking a community-first and open source approach to the product development of this tool. We believe government software should be made in the open and be built and licensed such that anyone can take the code, run it themselves without paying money to third parties or using proprietary software, and use it as they will.
The Justice40 team is taking a community-first and open source approach to the product development of this tool. We believe government software should be made in the open and be built and licensed such that anyone can take the code, run it themselves without paying money to third parties or using proprietary software, and use it as they will.

We know that we can learn from a wide variety of communities, including those who will use or will be impacted by the tool, who are experts in data science or technology, or who have experience in climate, economic,or environmental justice work. We are dedicated to creating forums for continuous conversation and feedback to help shape the design and development of the tool.
We know that we can learn from a wide variety of communities, including those who will use or will be impacted by the tool, who are experts in data science or technology, or who have experience in climate, economic,or environmental justice work. We are dedicated to creating forums for continuous conversation and feedback to help shape the design and development of the tool.

We also recognize capacity building as a key part of involving a diverse open source community. We are doing our best to use accessible language, provide technical and process documents in multiple languages, and offer support to our community members of a wide variety of backgrounds and skillsets, directly or in the form of group chats and training. If you have ideas for how we can improve or add to our capacity building efforts and methods for welcoming folks into our community, please let us know in the [Google Group](https://groups.google.com/u/4/g/justice40-open-source) or email us at justice40open@usds.gov.

### Community Guidelines
Principles and guidelines for participating in our open source community are available [here](COMMUNITY_GUIDELINES.md). Please read them before joining or starting a conversation in this repo or one of the channels listed below.
Principles and guidelines for participating in our open source community are available [here](COMMUNITY_GUIDELINES.md). Please read them before joining or starting a conversation in this repo or one of the channels listed below.

### Community Chats
We host open source community chats every third Monday of the month at 5-6pm ET. You can find information about the agenda and how to participate in our [Google Group](https://groups.google.com/u/4/g/justice40-open-source).

Community members are welcome to share updates or propose topics for discussion in community chats. Please do so in the Google Group.

### Google Group
Our [Google Group](https://groups.google.com/u/4/g/justice40-open-source) is open to anyone to join and share their knowledge or experiences, as well as to ask questions of the core Justice40 team or the wider community.
Our [Google Group](https://groups.google.com/u/4/g/justice40-open-source) is open to anyone to join and share their knowledge or experiences, as well as to ask questions of the core Justice40 team or the wider community.

The core team uses the group to post updates on the program and tech/data issues, and to share the agenda and call for community participation in the community chat.

Curious about whether to ask a question here as a Github issue or in the Google Group? The general rule of thumb is that issues are for actionable topics related to the tool or data itself (e.g. questions about a specific data set in use, or suggestion for a new tool feature), and the Google Group is for more general topics or questions. If you can't decide, use the google group and we'll discuss it there before moving to Github if appropriate!
Curious about whether to ask a question here as a Github issue or in the Google Group? The general rule of thumb is that issues are for actionable topics related to the tool or data itself (e.g. questions about a specific data set in use, or suggestion for a new tool feature), and the Google Group is for more general topics or questions. If you can't decide, use the google group and we'll discuss it there before moving to Github if appropriate!

## Contributing

Contributions are always welcome! We encourage contributions in the form of discussion on issues in this repo and pull requests of documentation and code.
Contributions are always welcome! We encourage contributions in the form of discussion on issues in this repo and pull requests of documentation and code.

See [CONTRIBUTING.md](CONTRIBUTING.md) for ways to get started.

Expand Down
39 changes: 39 additions & 0 deletions data/data-pipeline/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
exclude: ^client|\.csv
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/lucasmbrown/mirrors-autoflake
rev: v1.3
hooks:
- id: autoflake
args:
[
"--in-place",
"--remove-all-unused-imports",
"--remove-unused-variable",
"--ignore-init-module-imports",
]

- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
name: isort (python)
args:
[
"--force-single-line-imports",
"--profile=black",
"--line-length=80",
"--src-path=.:data/data-pipeline"
]

- repo: https://github.com/ambv/black
rev: 22.8.0
hooks:
- id: black
language_version: python3.9
args: [--config=./data/data-pipeline/pyproject.toml]
Loading

0 comments on commit 6e6223c

Please sign in to comment.