25 Commits

Author SHA1 Message Date
Qrox 86391d6cc6 Remove non-breaking spaces from JSON strings and make JSON formatter replace nbsp with escape sequence 2024-02-05 10:53:37 +08:00
Anton Simakov ff63981530 initial commit 2023-10-15 23:23:08 +02:00
Alexey c011e9de12 Improve output for JSON errors (#66623)
* Colorize JSON errors

* Make formatter feed source filename to TextJsonIn

* Throw exception instead of dumping output to std::cerr

* Adjust math parser's caret appearance

* Set color in chkjson

* Adjust tests and formatters

* Add json error cursor check for unicode string

* Squelch global state lint for entry points

* Adjust stream offset so the buffer for utf8_width is pointing at a codepoint
2023-07-17 19:51:50 -05:00
Andrew Krieger 2833d7a974 Rename Json* -> TextJson*, FlexJson* -> Json*, fixup fallout 2022-09-15 22:04:54 -07:00
haveric c380afc798 Fix spelling issues (#45878)
* JSON description spelling fixes
* Markdown + txt spelling fixes
* Fix FLAMMABLE_ASH flag for butchering rack
* Fix result spelling of southwest
* Fix cephalopod achievement id spelling
* unsually is probably unusually
* Fix spelling in dynamic line
* Simple comment/text spelling fixes
* Fix variable/enum spellings
* Fix function spelling issues
2020-12-08 16:46:14 -08:00
ZhilkinSerg b2fdd9abc4 Add JsonFormatter VS library project 2020-08-27 14:12:50 +03:00
John Bytheway 000ecc66aa Revamp style-json commands (#41101)
* Revamp json-styling commands in Makefile

* style-json now checks all non-blacklisted files, rather than stopping
  after the first failure.
* Dependencies fixed such that it doesn't compile the json_formatter
  executable every time you use these targets.

* Reduce json formatted spam

Stop printing anything for files that are well-formatted.  These lines
just clutter the CI output.

* Document some suggestions for git pre-commit

Show how to check json and code style in a pre-commit hook.
2020-06-06 20:26:53 +03:00
ZhilkinSerg 7264a72dfa Use constant references in function parameters 2020-05-29 11:01:28 +03:00
ZhilkinSerg ea6644e7e3 Proper emptiness check 2020-05-25 20:00:36 +03:00
Jason Jones 9d6a104bdb Build and use json_formatter in Visual Studio 2020-04-17 00:31:54 -08:00
Justen Robertson d67db553e3 Improve json linter log readability (#39597)
* feat: make json linter log easier to understand
* fix: fix astyle formatting in json formatter >.<
2020-04-15 22:42:59 -07:00
Qrox 7916a18a1e Preserve signedness in json formatter 2020-03-01 13:05:21 +08:00
Qrox dda097bd3d Fix null value handling in json formatter 2020-03-01 13:05:21 +08:00
Qrox 342170a427 Conserve escape sequences in json formatter & add json formatter to CMake lists 2019-12-30 03:23:10 +08:00
Davi 9a9247516b Mention JSON style guide in lint failure message
To inform new contributors of the existance of the style guide
expands on #34497
2019-10-08 20:37:18 -04:00
anothersimulacrum 4c1a279fc4 Make linting failure message more clear
Right now when a json file is not linted, the program just says
'Formatted $FILENAME' and exits - this doesn't make it particularly
clear what is wrong when a file is not linted.
This aims to make it more clear for new contributors.
2019-10-06 03:25:13 +00:00
John Bytheway 683c7efb27 Enforce astyle on tool sources (#31233)
* Astyle tools/format/format.cpp

* Enforce astyle on more files

The tools sources were not covered by astyle checks.  Make them be.

It looks like they used to be but the Makefile was not updated at some
point when the files moved.  Rearrange how the Makefile works to make
similar mistakes less likely to occur in the future.

Also, use ':=' assignment in some Makefile variables for better
efficiency.
2019-06-08 17:13:28 +03:00
Kevin Granade 253ecb573e Force all "rows" to wrap in json. (#29305)
* Force all "rows" and "blueprints" to wrap in json unless they're one entry.

* Restyle the nested mapgen entries.

* Restyle the blueprints.
2019-04-10 11:05:43 +03:00
Alexey Mostovoy b4ec781f01 Fixes #24461 2018-08-14 13:56:27 +03:00
ZhilkinSerg 892f56fcf4 Updated format.cpp to be usable under MSYS
Removes CR chars from formatted json string before string compare
2018-06-30 02:59:54 +03:00
Kevin Granade 5fb539e116 Check input file state in formatter. 2017-10-20 02:51:54 +00:00
Kevin Granade 494627732e Base object wraping on line length too. 2017-10-12 21:53:39 -07:00
Kevin Granade c72af3247c Add some json style documentation. 2017-10-12 21:53:39 -07:00
Kevin Granade a96dc17b10 Add minimal backtracking to wrap overly-long arrays. 2017-10-12 21:53:39 -07:00
Kevin Granade 80727432b2 Complete removal of perl json formatter. 2017-10-12 21:53:39 -07:00