pre-commit-text
Scripts to rewrite text files usable as pre-commit hooks
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.9%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Scripts to rewrite text files usable as pre-commit hooks
Basic Info
Statistics
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 25
Topics
Metadata Files
README.md
Scripts that can work as git hooks to modify (text) files.
These scripts can be called directly or with the provided configuration for the pre-commit framework.
For details see below.
Using pre-commit-text with pre-commit
Add this to your .pre-commit-config.yaml:
- repo: https://github.com/boidolr/pre-commit-text
rev: v1.2.19 # Use the ref you want to point at
hooks:
- id: pretty-format-yaml
- id: replace-tabs
# - id: ...
For an extended example see .pre-commit-config.yaml.
Available hooks
pretty-format-yaml: Format yaml files.--mappingspace to use as offset for mappings.--sequencespace to use as offset for sequences (default is value for mapping plus two).--preserve-quoteswhether to keep quoting as is or change to default.
properties-whitespace: Remove whitespace around equal signs in property files. Implemented using thesearch-replacehook.replace-tabs: Replace tabs in files.--tabsizespaces to replace a tab with.
search-replace: Replace patterns in files.--searchregular expression to use for search.--replacementreplacement for matches.
Using scripts directly
Install the package to get access to the scripts defined as command line entry points in pyproject.toml.
The scripts accept the arguments given for the pre-commit hooks. Additionally they exepect to receive the file names to work on.
An example invocation could be uvx --from 'git+https://github.com/boidolr/pre-commit-text.git' format-yaml --preserve-quotes .github/release.yml.
Available entry points are:
format-yamlreplace-tabssearch-replace
Owner
- Name: Raphael Boidol
- Login: boidolr
- Kind: user
- Location: Munich, Germany
- Company: @TNG
- Website: https://boidolr.github.io/
- Repositories: 12
- Profile: https://github.com/boidolr
coding for the fun of it
Citation (CITATION.cff)
cff-version: 1.2.0 message: "If you use this software, please cite it as below." authors: - family-names: "Boidol" given-names: "Raphael" title: "pre-commit-text" abstract: >- pre-commit-text will rewrite text or format files when checking changes in, thereby ensuring content is as you want it to be. license: MIT license-url: "https://github.com/boidolr/pre-commit-text/blob/main/LICENSE" repository-code: "https://github.com/boidolr/pre-commit-text" url: "https://github.com/boidolr/pre-commit-text"
GitHub Events
Total
- Release event: 1
- Delete event: 67
- Push event: 92
- Pull request review event: 4
- Pull request event: 132
- Create event: 66
Last Year
- Release event: 1
- Delete event: 67
- Push event: 92
- Pull request review event: 4
- Pull request event: 132
- Create event: 66
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| renovate[bot] | 2****] | 191 |
| Raphael Boidol | b****r | 89 |
| github-actions | 4****] | 52 |
| github-actions | g****s@g****m | 15 |
| Renovate Bot | b****t@r****m | 4 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 0
- Total pull requests: 137
- Average time to close issues: N/A
- Average time to close pull requests: about 3 hours
- Total issue authors: 0
- Total pull request authors: 2
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 132
- Bot issues: 0
- Bot pull requests: 123
Past Year
- Issues: 0
- Pull requests: 119
- Average time to close issues: N/A
- Average time to close pull requests: about 3 hours
- Issue authors: 0
- Pull request authors: 2
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 114
- Bot issues: 0
- Bot pull requests: 105
Top Authors
Issue Authors
Pull Request Authors
- renovate[bot] (224)
- boidolr (24)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout v3 composite
- github/codeql-action/analyze v2 composite
- github/codeql-action/init v2 composite
- actions/checkout v3 composite
- boidolr/actions/python-pip-env main composite
- boidolr/actions/run-precommit main composite
- boidolr/actions/create-release main composite
- actions/checkout v3 composite
- boidolr/actions/git-push main composite
- boidolr/actions/run-precommit main composite