pre-commit-text

Scripts to rewrite text files usable as pre-commit hooks

https://github.com/boidolr/pre-commit-text

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

git-hooks pre-commit refactoring

Keywords from Contributors

avif image-optimization jpeg png wavelets ros robust slepian-functions manifolds standardization
Last synced: 4 months ago · JSON representation ·

Repository

Scripts to rewrite text files usable as pre-commit hooks

Basic Info
  • Host: GitHub
  • Owner: boidolr
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 529 KB
Statistics
  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 25
Topics
git-hooks pre-commit refactoring
Created almost 4 years ago · Last pushed 5 months ago
Metadata Files
Readme License Citation Codeowners

README.md

pre-commit-text tag python Build

pre-commit

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.
    • --mapping space to use as offset for mappings.
    • --sequence space to use as offset for sequences (default is value for mapping plus two).
    • --preserve-quotes whether to keep quoting as is or change to default.
  • properties-whitespace: Remove whitespace around equal signs in property files. Implemented using the search-replace hook.
  • replace-tabs: Replace tabs in files.
    • --tabsize spaces to replace a tab with.
  • search-replace: Replace patterns in files.
    • --search regular expression to use for search.
    • --replacement replacement 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-yaml
  • replace-tabs
  • search-replace

Owner

  • Name: Raphael Boidol
  • Login: boidolr
  • Kind: user
  • Location: Munich, Germany
  • Company: @TNG

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

All Time
  • Total Commits: 351
  • Total Committers: 5
  • Avg Commits per committer: 70.2
  • Development Distribution Score (DDS): 0.456
Past Year
  • Commits: 105
  • Committers: 2
  • Avg Commits per committer: 52.5
  • Development Distribution Score (DDS): 0.2
Top Committers
Name Email 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 (226) github-tags (150) github-actions (95) pep621 (64) pre-commit (55) github-releases (9) regex (9) poetry (1) pypi (1)

Dependencies

.github/workflows/codeql-analysis.yml actions
  • actions/checkout v3 composite
  • github/codeql-action/analyze v2 composite
  • github/codeql-action/init v2 composite
.github/workflows/continous-integration.yml actions
  • actions/checkout v3 composite
  • boidolr/actions/python-pip-env main composite
  • boidolr/actions/run-precommit main composite
.github/workflows/create-release.yml actions
  • boidolr/actions/create-release main composite
.github/workflows/pre-commit-update.yml actions
  • actions/checkout v3 composite
  • boidolr/actions/git-push main composite
  • boidolr/actions/run-precommit main composite
pyproject.toml pypi