Uploaded image for project: 'Maven Checkstyle Plugin'
  1. Maven Checkstyle Plugin
  2. MCHECKSTYLE-440

how to reuse the checkstyle cache from a new environment

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Information Provided
    • 3.3.0
    • None
    • checkstyle:check
    • None

    Description

      Hi, dear Checkstyle plugin team,
        
      This is Nianjun from the Apache/ShardingSphere team. Recently, we added the checkstyle:check as required check in our GitHub action. This action is triggered by every single pull request and checks the Java code style for all modules.
        
      I noticed that running checkstyle:check takes almost 1 minute to check nearly 300 modules.this takes too much time for the reviewer to merge the code. I know that Checkstyle generates a cache file called 'checkstyle-cachefile' in the target folder. So, I tried caching all 'checkstyle-cachefile' files in the target folder by 
      actions/cache@v3 for the next GitHub action run.  
      However, this approach didn't work and I'm not sure how the Checkstyle cache works...
        
      Interestingly, when I execute the command `mvn checkstyle:check -Dcheckstyle.skip=false -T1C` twice in our GitHub action, it only takes 15 seconds on the second run. This makes me think that the cache file is working.
        
      I also tried downloading these 'checkstyle-cachefile' files from GitHub's cache and putting them in each module's target folder, but it still takes 1 minute to complete.
        
      I'm not sure if 'checkstyle-cachefile' has an expiration period or if it depends on some environment information or something else entirely. Could you please provide some tips or give me a brief description of how 'checkstyle-cachefile' works?
        
      Thank you!

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            sunnianjun Nianjun Sun
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment