Go to the Checkstyle configuration page via File → Settings, then
checkstyle into the search box:
Press the plus icon to add your checkstyle.xml. Activate your
checkstyle.xml by clicking the checkbox in the column labeled
That's it! If you want real-time scans, you can go to the Inspections
dialog and activate the real-time scan.