All Projects → huitseeker → comby-rust

huitseeker / comby-rust

Licence: MPL-2.0 license
Rust refactoring templates for comby, the structural find-and-replace tool.

Programming Languages

rust
11053 projects
shell
77523 projects

Projects that are alternatives of or similar to comby-rust

Comby
A tool for structural code search and replace that supports ~every language.
Stars: ✭ 912 (+3865.22%)
Mutual labels:  refactoring, parsing, linting
php.json
A library for simplifying JSON linting and validation.
Stars: ✭ 59 (+156.52%)
Mutual labels:  parsing, linting
colisper
Check and transform Lisp code with Comby (beta)
Stars: ✭ 18 (-21.74%)
Mutual labels:  refactoring, comby
docker-go-dev
The containerized Go development environment.
Stars: ✭ 93 (+304.35%)
Mutual labels:  linting
htmlparsing
htmlparsing.com, a website devoted to helping people parse HTML correctly
Stars: ✭ 29 (+26.09%)
Mutual labels:  parsing
ansicolor
A JavaScript ANSI color/style management. ANSI parsing. ANSI to CSS. Small, clean, no dependencies.
Stars: ✭ 91 (+295.65%)
Mutual labels:  parsing
deleft.vim
Delete a wrapping if-clause, try-catch block, etc. and shift left.
Stars: ✭ 68 (+195.65%)
Mutual labels:  refactoring
eslint-plugin-chai-friendly
Makes eslint friendly towards Chai.js 'expect' and 'should' statements.
Stars: ✭ 49 (+113.04%)
Mutual labels:  linting
dpar
Neural network transition-based dependency parser (in Rust)
Stars: ✭ 41 (+78.26%)
Mutual labels:  parsing
checksync
A tool for detecting when related text blocks change
Stars: ✭ 14 (-39.13%)
Mutual labels:  linting
fyodor
Convert your Amazon Kindle highlights and notes into markdown (or any format).
Stars: ✭ 101 (+339.13%)
Mutual labels:  parsing
FAParser
JSON Parsing + Archiving & Unarchiving in User Defaults
Stars: ✭ 67 (+191.3%)
Mutual labels:  parsing
eslint-plugin-import
ESLint plugin with rules that help validate proper imports.
Stars: ✭ 4,290 (+18552.17%)
Mutual labels:  linting
CVparser
CVparser is software for parsing or extracting data out of CV/resumes.
Stars: ✭ 28 (+21.74%)
Mutual labels:  parsing
refactor-css
Helps you identify reoccurring CSS class name combinations in your markup
Stars: ✭ 28 (+21.74%)
Mutual labels:  refactoring
wallhaven4j
Wallhaven API for Java
Stars: ✭ 17 (-26.09%)
Mutual labels:  parsing
docx2csv
Extracts tables from .docx files and saves them as .csv or .xls files
Stars: ✭ 42 (+82.61%)
Mutual labels:  parsing
OpenSIEM-Logstash-Parsing
SIEM Logstash parsing for more than hundred technologies
Stars: ✭ 140 (+508.7%)
Mutual labels:  parsing
li18nt
🌎 Lint your i18n translation files. Detect conflicting properties, duplicates and make it more readable and easier to maintain by formatting it!
Stars: ✭ 29 (+26.09%)
Mutual labels:  linting
pe
Fastest general-purpose parsing library for Python with a familiar API
Stars: ✭ 21 (-8.7%)
Mutual labels:  parsing

comby-rust

Rewrite rules for Rust code using the comby refactoring tool.

Overview

This structural find-and-replace tool allows implementing rules with different purposes:

  • templates.toml: refactorings that are non-controversial and will require minimal manual supervision a posteriori. They should not change code semantics.
  • experimental-templates.toml: refactorings that are a matter of style, or will require modifications in a large number of cases, but may still be useful.
  • nopanic.toml: refactorings that remove panics (and therefore change semantics).

Requirements and installation

Please refer to the comby installation and usage instructions.

Running

  • comby -config templates.toml -f .rs finds matches
  • comby -config templates.toml -f .rs -i replaces file contents
  • You may want to run cargo clean before running the above
  • You should run cargo fmt after running the above

Exclude target directory with:

  • comby -config template.toml -f .rs -i -exclude-dir target

Testing

See the test/run.sh script for templates and expected results.

See also

go-patterns, a similar pattern repo for the Go language, which inspired this.

Licence

Copyright 2021 François Garillot

This software is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].