Commit Graph

21 Commits

Author SHA1 Message Date
Danny Mösch 2e87be0398 Infer name of parent rule in configurations (#6363) 2025-12-01 14:15:00 -05:00
Danny Mösch aa67f5ac13 Adopt typed throws where possible (#5922) 2025-09-27 19:11:46 +02:00
Danny Mösch 2578cb3862 Use SwiftSyntax version 601.0.0 (#6003) 2025-04-03 21:27:57 +02:00
Danny Mösch 7385beaaf6 Add validation hook to configuration parsing (#5824) 2024-10-17 23:13:17 +02:00
Vladimir Burdukov 0d04196f92 Do not throw deprecation warning if property is not present in configuration (#5792) 2024-09-15 21:13:31 +02:00
Danny Mösch 98cf87ab8d Rename macros to something more descriptive (#5686) 2024-07-23 20:14:29 +02:00
Danny Mösch cc4b569c54 Enable unused_parameter rule and fix all violations (#5673) 2024-07-14 11:20:50 -04:00
Danny Mösch c810459e6a Enforce mandatory trailing comma and fix all violations (#5640) 2024-06-28 05:36:50 +00:00
Danny Mösch c29391a5ae Ignore but report invalid keys (#5567)
Don't fall back to the default configuration due to invalid keys.
2024-05-11 10:28:10 +00:00
Danny Mösch 1b7fbc4bcd Make postprocessors non-throwing (#5539)
Failing immediately when a property is invalid is too strict. It feels
sufficient to allow to report an issue but otherwise continue with a default
value instead of stopping execution completely.
2024-04-23 16:45:59 -04:00
Danny Mösch 299042a233 Allow to configure only severity in a short form for every rule with a severity (#5509)
The README states that a configuration like `attributes: error` is
valid to only set a different severity level for a rule (the
`attributes` rule here). This was previously only possible for rules
that were accompanied by a plain severity configuration.

I don't think this broke with the automatic parsing code generation.
For some rules it might have worked before, for others not. This change
makes it consistently working for all rules.
2024-03-25 21:40:56 +01:00
Danny Mösch dfa7f2fd4d Use result builder to fix indentation (#5507) 2024-03-24 09:04:36 +00:00
Danny Mösch e6bb673444 Handle issues in nested contexts gracefully while still throwing standalone
Use different issues to make inlineable configurations work in both
scenarios, namely being used standalone and nested as part of another
configuration. In the latter case, finding no values to parse in a raw
configuration is okay, while as a standalone configuration it's not.
2024-03-24 09:36:18 +01:00
Danny Mösch ccd50e8c68 Merge duplicated issues 2024-03-24 09:36:18 +01:00
Danny Mösch 82cad0bfff Allow to infer option names (#5505)
This allows to infer names of options from their names in a configuration. CamelCase is translated into snake_case automatically when `apply` is triggered.

* Don't have all `RuleConfiguration`s conform to `InlinableOptionType`. Mark types that must have this capability explicitly. Same for `AcceptableByConfigurationElement`.
* A type being an `InlinableOptionType` doesn't mean it's automatically inlined. This also doesn't depend on the fact of having a name for its key configured any longer. Instead, an `inline` attribute must explicitly be set to `true` in `@ConfigurationElement`.
* Key name inference is optional and can be overwritten by specifying a key name in the attribute.
* Inlined configurations only fail in `apply` when they are really sure that something is odd. Otherwise, they accept to not being updated.
2024-03-23 18:54:39 +01:00
Danny Mösch fb4ef951ee Print invalid keys when configuration parsing fails (#5350) 2023-11-14 23:43:38 +01:00
Danny Mösch 3ce2d60938 Move and rename macro errors 2023-10-19 21:35:57 +02:00
Danny Mösch 5ee0ff9535 Inline constants 2023-10-19 21:35:57 +02:00
Danny Mösch ca045a236b Use enums for macro implementations 2023-10-19 21:35:57 +02:00
Danny Mösch 4716f59c54 Add tests for RuleConfigurationMacros (#5256) 2023-10-03 12:42:32 +02:00
Danny Mösch 2433e7b5bf Make use of macros to generate configuration parsing code (#5250) 2023-10-02 22:35:24 +02:00