fastmod: add page (#7815)

feature/windows-fix-syntax-2
محمد الصوالحي 2022-03-09 12:58:38 +02:00 committed by GitHub
parent 8628cba2eb
commit 37ab478d79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,29 @@
# fastmod
> أداة للاستبدال الجزئي للنصوص في قاعدة الأكواد لديك.
> التعبيرات النمطية يعالجها قفص من بضاعة رست وهو regex.
> لمزيد من العلومات: <https://github.com/facebookincubator/fastmod>.
- استبدال بالتعبيرات النمطية في كل ملفات المسار الحالي وأبنائه في الملفات غير المُتجاهلة بـ .ignore أو .gitignore:
`fastmod {{تعبير_نمطي}} {{بديل}}`
- استبدال متجاهلا حالة الحرف في ملف أو في ملفات مسار:
`fastmod --ignore-case {{تعبير_نمطي}} {{بديل}} -- {{مسار/الـ/ملف مسار/الـ/السجل ...}}`
- استبدال بالتعبيرات النمطية مع تحديد المكان الذي يُستبدل فيه:
`fastmod {{تعبير_نمطي}} {{بديل}} --dir {{مسار/للـ/سجل}} --iglob {{'**/*.{js,json}'}}`
- استبدال بالنص مُطابقةً (وليس التعبيرات النمطية)، في ملفات امتداداتهم إما js أو json فحسب:
`fastmod --fixed-strings {{نص_مطابِق}} {{بديل}} -e {{json,js}}`
- استبدال بجميع النصوص مُطابقةً، مباشرة دون مِحَثِّ تأكيد (prompt):
`fastmod --accept-all --fixed-strings {{نص_مطابِق}} {{بديل}}`
- استبدال بجميع النصوص مُطابقةً، مباشرة دون تأكيد، مع طباعة الملفات المُستبدل فيها:
`fastmod --accept-all --print-changed-files --fixed-strings {{نص_مطابِق}} {{بديل}}`

29
pages/common/fastmod.md Normal file
View File

@ -0,0 +1,29 @@
# fastmod
> A fast partial replacement for the codemod tool, replace and replace all in the whole codebase.
> Regexes are matched by Rust regex crate.
> More information: <https://github.com/facebookincubator/fastmod>.
- Replace a regex pattern in all files of the current directory, ignoring files on .ignore and .gitignore:
`fastmod {{regex_pattern}} {{replacement}}`
- Replace a regex pattern in case-insensitive mode in specific files or directories:
`fastmod --ignore-case {{regex_pattern}} {{replacement}} -- {{path/to/file path/to/directory ...}}`
- Replace a regex pattern in in a specific directory files filtered with a case-insensitive glob pattern:
`fastmod {{regex}} {{replacement}} --dir {{path/to/directory}} --iglob {{'**/*.{js,json}'}}`
- Replace for an exact string in .js or .json files:
`fastmod --fixed-strings {{exact_string}} {{replacement}} --extensions {{json,js}}`
- Replace for an exact string without prompt for a confirmation (disables regular expressions):
`fastmod --accept-all --fixed-strings {{exact_string}} {{replacement}}`
- Replace for an exact string without prompt for a confirmation, printing changed files:
`fastmod --accept-all --print-changed-files --fixed-strings {{exact_string}} {{replacement}}`