Skip to content

Commit

Permalink
add pre-commit; pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AFg6K7h4fhy2 committed Sep 25, 2024
1 parent fa3348b commit 60e12b6
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 6 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@
*.json text eol=lf
*.yml text eol=lf
*.csv text eol=lf

16 changes: 16 additions & 0 deletions .github/actions/pre-commit/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: pre-commit
description: run pre-commit
inputs:
extra_args:
description: options to pass to pre-commit run
required: false
default: '--all-files'
runs:
using: composite
steps:
- run: python -m pip install pre-commit
shell: bash
- run: python -m pip freeze --local
shell: bash
- run: pre-commit run --show-diff-on-failure --color=always ${{ inputs.extra_args }}
shell: bash
14 changes: 14 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pre-commit

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: ./.github/actions/pre-commit
43 changes: 43 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
repos:
################################################################################
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
args: ['--maxkb=10000']
- id: check-yaml
args: [--allow-multiple-documents]
- id: check-toml
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
################################################################################
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
hooks:
- id: black-jupyter
args: ['--line-length', '79']
language_version: python3
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
args: ['--profile', 'black',
'--line-length', '79']
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.7
hooks:
- id: ruff
args: ['--ignore=E741', '--ignore=E731', '--fix']
################################################################################
- repo: https://github.com/rhysd/actionlint
rev: v1.7.1
hooks:
- id: actionlint
################################################################################
- repo: https://github.com/crate-ci/typos
rev: v1.21.0
hooks:
- id: typos
args: ["--force-exclude"]
################################################################################
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"ISSO",
"cybersecurity"
]
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**Template for clearance: This project serves as a template to aid projects in starting up and moving through clearance procedures. To start, create a new repository and implement the required [open practices](open_practices.md), train on and agree to adhere to the organization's [rules of behavior](rules_of_behavior.md), and [send a request through the create repo form](https://forms.office.com/Pages/ResponsePage.aspx?id=aQjnnNtg_USr6NJ2cHf8j44WSiOI6uNOvdWse4I-C2NUNk43NzMwODJTRzA4NFpCUk1RRU83RTFNVi4u) using language from this template as a Guide.**

**General disclaimer** This repository was created for use by CDC programs to collaborate on public health related projects in support of the [CDC mission](https://www.cdc.gov/about/organization/mission.htm). GitHub is not hosted by the CDC, but is a third party website used by CDC and its partners to share information and collaborate on software. CDC use of GitHub does not imply an endorsement of any one particular service, product, or enterprise.
**General disclaimer** This repository was created for use by CDC programs to collaborate on public health related projects in support of the [CDC mission](https://www.cdc.gov/about/organization/mission.htm). GitHub is not hosted by the CDC, but is a third party website used by CDC and its partners to share information and collaborate on software. CDC use of GitHub does not imply an endorsement of any one particular service, product, or enterprise.

## Access Request, Repo Creation Request

Expand All @@ -20,7 +20,7 @@
## Overview

Describe the purpose of your project. Add additional sections as necessary to help collaborators and potential collaborators understand and use your project.

## Public Domain Standard Notice
This repository constitutes a work of the United States Government and is not
subject to domestic copyright protection under 17 USC § 105. This repository is in
Expand Down
4 changes: 2 additions & 2 deletions rules_of_behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Examples of information which has been deemed not sensitive and may be posted on
* Process flows
* Program pain points
* Software Service Descriptions

Sensitive information, which should not be posted, includes (but is not limited to) the following.

* Information directly attributed to an individual in a sensitive manner
Expand All @@ -59,7 +59,7 @@ Sensitive information, which should not be posted, includes (but is not limited
* Non-public Links to CDC SharePoint or other internal references
* Non-public Details on CDC internal infrastructure

If there’s any question on whether information may be sensitive (such as detailed interview notes or specific references provided during a program interview), further guidance should be sought from the security steward prior to posting the information on any GitHub.
If there’s any question on whether information may be sensitive (such as detailed interview notes or specific references provided during a program interview), further guidance should be sought from the security steward prior to posting the information on any GitHub.

## Enforcement

Expand Down

0 comments on commit 60e12b6

Please sign in to comment.