summaryrefslogtreecommitdiff
path: root/src/fixits.c
Commit message (Collapse)AuthorAgeFilesLines
* package: bump copyrights to 2020Akim Demaille2020-01-051-1/+1
| | | | Run 'make update-copyright'.
* gnulib: use new features of the argmatch moduleAkim Demaille2019-07-031-1/+1
| | | | | | | | | | | | It can now generate the usage message. * src/complain.h (feature_fixit_parsable): Rename as... (feature_fixit): this, for column economy. Adjust dependencies. (warning_usage): New. Use it. * src/complain.h, src/complain.c, src/getargs.h, src/getargs.c: Use ARGMATCH_DEFINE_GROUP instead of the older interface.
* fixits: sort them before applying themAkim Demaille2019-05-081-1/+6
| | | | | | | | | | An experimental commit introduced a fix-it hint that changes comments such as "/* empty */" into %empty. But in some case, because diagnostics are not necessarily emitted in order, the fixits also come in disorder, which must never happen, as the fixes are installed in one pass. * src/fixits.c (fixits_register): Insert them in order.
* fixits: track byte-columns, not character-columnsAkim Demaille2019-04-241-6/+17
| | | | | | | | | | | | | | | | | | | | | Because the fix-its were ready the character-based columns, but were applied on byte-based columns, the result with multibyte characters or tabs could be "interesting". For instance %fixed-output_files %fixed_output-files %fixed-output-files %define api.prefix {foo} %no-default-prec would give %fixed-%fixed-output-files %fixed_output-files %fixed-orefix= "foo" o_default-prec * src/fixits.c (fixit_print, fixits_run): Work on byte-base columns. * tests/input.at: Check it.
* fixits: suggest running --update if there are fixitsAkim Demaille2019-01-161-0/+7
| | | | | | | | | | | * src/fixits.h, src/fixits.c (fixits_empty): New. * src/complain.c (deprecated_directive): Register the Wdeprecated fixits only if -Wdeprecated was enabled, so that we don't apply updates if the user didn't ask for them. * src/main.c (main): If there were fixits, issue a warning suggesting running with --update. Free uniqstrs after the fixits, since the latter use the former. * tests/headers.at, tests/input.at: Update expectations.
* fixits: avoid generating empty linesAkim Demaille2019-01-161-0/+15
| | | | | | * src/fixits.c (fixits_run): If erase the content of a line, also erase the following \n. * tests/input.at (Deprecated directives): Update expectations.
* Revert the last two commitsAkim Demaille2019-01-141-8/+0
| | | | | | | | They should not have been pushed, sorry about that. This reverts - commit 8575bd06ae6e65f3a30b21a3e022a968e4c7ae7a. - commit 55bf52860eac5c1394dc344a691220272df32b09.
* WIPAkim Demaille2019-01-141-0/+8
|
* diagnostics: update the grammar fileAkim Demaille2019-01-141-1/+96
| | | | | | | | | Let's use the fixits to actually update the grammar files. * src/getargs.h, src/getargs.c (update_flag): New. * src/fixits.h, src/fixits.c (fixits_run): New. * src/main.c (main): Invoke fixits_run when --update is passed. * tests/input.at (Deprecated directives): Check --update.
* diagnostics: keep the fixitsAkim Demaille2019-01-141-0/+95
Introduce proper support for fixits, instead of just printing them on demand. * bootstrap.conf: We need gnulib's xlists. * src/fixits.h, src/fixits.c: New. * src/complain.c (deprecated_directive): Use fixits_register. * src/main.c (main): Use fixits_free.