diff options
author | Sergio Martins <smartins@kde.org> | 2019-05-05 14:04:34 +0100 |
---|---|---|
committer | Sergio Martins <sergio.martins@kdab.com> | 2019-05-05 18:19:23 +0100 |
commit | 2555ccc9f942710aee6634536a7df1a5c28af945 (patch) | |
tree | ff98f68a4e2ca0a8e9f944f4667b1cc4dc333c0d | |
parent | 05c9ccade074fb7468f7983990b9697accd07fe1 (diff) |
Update README and Changelog
-rw-r--r-- | Changelog | 6 | ||||
-rw-r--r-- | README.md | 15 |
2 files changed, 11 insertions, 10 deletions
@@ -109,3 +109,9 @@ * v1.6 (, 2019) - Moved all level3 checks to manual level. Doesn't make sense to enable all of them. Each one must be carefully considered. + - Fixit infrastructure was overhauled + Clazy no longer rewrites files directly, to avoid races when parallel invocations change the same header. + Clazy now exports a yaml file with the replacements, to be applied with clang-apply-replacements. The same way other clang tooling do it. + The way to enable code rewrite is now: -Xclang -plugin-arg-clazy -Xclang export-fixes for clang or -export-fixes=somefile.yaml for clazy-standalone + All other fixit arguments and fixit env variables were removed + Thanks to Christian Gagneraud for contributing the fixit yaml exporter! @@ -361,17 +361,11 @@ If that doesn't work, run `clang -v` and check what's the InstalledDir. Move cla # Enabling Fixits -Some checks support fixits, in which clazy will re-write your source files whenever it can fix something. -You can enable a fixit through the env variable, for example: -`export CLAZY_FIXIT="fix-qlatin1string-allocations"` +Some checks support fixits, in which clazy will help re-write your source files whenever it can fix something. +Simply pass `-Xclang -plugin-arg-clazy -Xclang export-fixes` to clang, or `-export-fixes=somefile.yaml` for `clazy-standalone`. +Then run `clang-apply-replacements <folder_with_yaml_files>`, which will modify your code. -Only one fixit can be enabled each time. -**WARNING**: Backup your code, don't blame me if a fixit is not applied correctly. -For better results don't use parallel builds, otherwise a fixit being applied in an header file might be done twice. - -By default clazy will rewrite your file, but it's suggested that you set the `CLAZY_FIXIT_SUFFIX` env variable to something like -`_clazy`. This will make clazy generate a new file with the fixes, suffixed with a string of your choice instead of overwriting the original -one. Otherwise the build would most likely fail due to rewriting code and compiling at the same time. +**WARNING**: Backup your code and make sure all changes done by clazy are correct. # Troubleshooting @@ -467,6 +461,7 @@ with contributions from: - Hannah von Reth - Volker Krause - Christian Ehrlicher +- Christian Gagneraud and thanks to: |