<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/146765>146765</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] add new option `--(dump/create)-default-config`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            enhancement,
            clang-tidy
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          vbvictor
      </td>
    </tr>
</table>

<pre>
    After completion of https://github.com/llvm/llvm-project/issues/146482, there would be no default checks enable, which can potentially confuse users.
We should provide an easy way to start using clang-tidy for new users.

I propose a new option `--dump-default-config` or `--create-default-config`. This option will create a `.clang-tidy` config with some checks enabled by default. The default config will be a good start for users to "just run analysis" and later explore more checks.
The list of default checks is largely debatable, possible a mixture of `bugprone`, `modernize`, `misc` and `performace` that has a low number of false positives. 

Alternative solution suggested by @nicovank:

If no checks are enabled, the default config should just be used directly. Maybe adding warnings saying 1. the default config/checks will be used and 2. use `--dump-default-config` to get started with a custom configuration file in that directory. It's better user experience to just run with the default config immediately rather than add one setup step.

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykVEuP4zYT_DX0pWFBoh4zPugw37cwsIfcAuTcIlsSdylS4MNe5dcHLdmZyewil1z8kNjV3VXFwhjN5Ih60f5PtF9OmNPsQ38bbkYlH06D11v_NiYKoPyyWkrGO_AjzCmtUdRvQl6FvE4mzXkolF-EvFp7e36d1-C_kUpCXk2MmaKQ16rpmlcp5P8hzRQI7j5bDQOB86BpxGwTqJnU9wjkcLDER--zUTModLD6RC4ZtHYD5d2YI0GOFGIhyrc_COK8463B34wmQAeEcYM7bpA8xIQhQY7GTaAsuumcjN5g9AEc3d-BRPn2lTFWHwlwf-fXfXfRleezzst6fgx75inMJLoSfDheq0CY6OcDBfw-m_hEuhtr4TgKyIXF-0SMdpTB3aQZol_on6xoGLYnX4xL7-Q966xlWhEm7_Vjc150X5LJEFJ-yzFByA7Qod2iiUJKQKfBImtOP1brA8HCH0d7Zoe7WRMTG-GTZCaCxTCR5eEGTE8BVx-jGSyPs5gfKQfiYtGVQ57W4B2JruRzoisXryk48-fHRyYqpoQnE125Uhh9WFDxEUgzJpgxAoL1d3B5GSgw-og2Enc2ydwoFnAI-2YTBYf8DKK3eRcj5mmimA5aRVM6o_wN3Xe2-GGHkQ362BIDPWV4GPkz-w8b7vwOu0M1aBNIJbsV8BturIzW7MM7BmfcFCHixv-r4heAQl4fvZ-67pBMiCz4978aM3mYKB0eIH1YCkHlmPzyaJAD7kSMxhIYd7B6TOzDVsDXJORLhIESG4M9xO6gYMgp4gZ_W2lH_wUlZllIG0zsjYB8-bmJYxrAO4JIKa8QE63ssZPua32pL3iivnppq-a1rdrmNPdd2equruWITavqV103QyOb5qJGpbEa6WR6Wcq2fClldakvVV3UdGmaoerGaiibqqxFU9KCxhYcUYUP02kPp75qupeuPVkcyMY9EaUkN6NTtJBLQnJqCSk_XFMpOTVDv4fdkKcompJvRnzHTibZPV8_lLVf9q0_x4qQrywga73HgpCXn8U85WD7_xS_vOStl38FAAD__wNtCtY">