{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,9,30]],"date-time":"2026-09-30T05:53:19Z","timestamp":1790747599036,"version":"4.1.0"},"reference-count":30,"publisher":"Springer Science and Business Media LLC","issue":"6","license":[{"start":{"date-parts":[[2022,8,6]],"date-time":"2022-08-06T00:00:00Z","timestamp":1659744000000},"content-version":"tdm","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0"},{"start":{"date-parts":[[2022,8,6]],"date-time":"2022-08-06T00:00:00Z","timestamp":1659744000000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0"}],"funder":[{"DOI":"10.13039\/501100004270","name":"Royal Institute of Technology","doi-asserted-by":"crossref","id":[{"id":"10.13039\/501100004270","id-type":"DOI","asserted-by":"crossref"}]}],"content-domain":{"domain":["link.springer.com"],"crossmark-restriction":false},"short-container-title":["Empir Software Eng"],"published-print":{"date-parts":[[2022,11]]},"abstract":"<jats:title>Abstract<\/jats:title><jats:p>Ensuring the consistent usage of formatting conventions is an important aspect of modern software quality assurance. To do so, the source code of a project should be checked against the formatting conventions (or rules) adopted by its development team, and then the detected violations should be repaired if any. While the former task can be automatically done by format checkers implemented in linters, there is no satisfactory solution for the latter. Manually fixing formatting convention violations is a waste of developer time and code formatters do not take into account the conventions adopted and configured by developers for the used linter. In this paper, we present <jats:sc>Styler<\/jats:sc>, a tool dedicated to fixing formatting rule violations raised by format checkers using a machine learning approach. For a given project, <jats:sc>Styler<\/jats:sc> first generates training data by injecting violations of the project-specific rules in violation-free source code files. Then, it learns fixes by feeding long short-term memory neural networks with the training data encoded into token sequences. Finally, it predicts fixes for real formatting violations with the trained models. Currently, <jats:sc>Styler<\/jats:sc> supports a single checker, Checkstyle, which is a highly configurable and popular format checker for Java. In an empirical evaluation, <jats:sc>Styler<\/jats:sc> repaired 41% of 26,791 Checkstyle violations mined from 104 GitHub projects. Moreover, we compared <jats:sc>Styler<\/jats:sc> with the IntelliJ plugin <jats:sc>CheckStyle-IDEA<\/jats:sc> and the machine-learning-based code formatters <jats:sc>Naturalize<\/jats:sc> and <jats:sc>CodeBuff<\/jats:sc>. We found out that <jats:sc>Styler<\/jats:sc> fixes violations of a diverse set of Checkstyle rules (24\/25 rules), generates smaller repairs in comparison to the other systems, and predicts repairs in seconds once trained on a project. Through a manual analysis, we identified cases in which <jats:sc>Styler<\/jats:sc> does not succeed to generate correct repairs, which can guide further improvements in <jats:sc>Styler<\/jats:sc>. Finally, the results suggest that <jats:sc>Styler<\/jats:sc> can be useful to help developers repair Checkstyle formatting violations.<\/jats:p>","DOI":"10.1007\/s10664-021-10107-0","type":"journal-article","created":{"date-parts":[[2022,8,6]],"date-time":"2022-08-06T07:14:24Z","timestamp":1659770064000},"update-policy":"https:\/\/doi.org\/10.1007\/springer_crossmark_policy","source":"Crossref","is-referenced-by-count":14,"title":["Styler: learning formatting conventions to repair Checkstyle violations"],"prefix":"10.1007","volume":"27","author":[{"given":"Benjamin","family":"Loriot","sequence":"first","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-2048-7648","authenticated-orcid":false,"given":"Fernanda","family":"Madeiral","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Martin","family":"Monperrus","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"297","published-online":{"date-parts":[[2022,8,6]]},"reference":[{"key":"10107_CR1","doi-asserted-by":"publisher","unstructured":"Aftandilian E, Sauciuc R, Priya S, Krishnan S (2012) Building Useful Program Analysis Tools Using an Extensible Java Compiler. In: Proceedings of the 12th IEEE International Working Conference on Source Code Analysis and Manipulation (SCAM \u201912), IEEE Computer Society, USA, pp 14\u201323 https:\/\/doi.org\/10.1109\/SCAM.2012.28","DOI":"10.1109\/SCAM.2012.28"},{"key":"10107_CR2","doi-asserted-by":"publisher","unstructured":"Ahmed UZ, Kumar P, Karkare A, Kar P, Gulwani S (2018) Compilation Error Repair: For the Student Programs, From the Student Programs. In: Proceedings of the 40th International Conference on Software Engineering: Software Engineering Education and Training (ICSE-SEET \u201918), Association for Computing Machinery, New York, NY, USA, pp 78\u201387, https:\/\/doi.org\/10.1145\/3183377.3183383","DOI":"10.1145\/3183377.3183383"},{"key":"10107_CR3","doi-asserted-by":"publisher","unstructured":"Allamanis M, Barr ET, Bird C, Sutton C (2014) Learning Natural Coding Conventions. In: Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering (FSE \u201914), Association for Computing Machinery, New York, NY, USA, pp 281\u2013293 https:\/\/doi.org\/10.1145\/2635868.2635883https:\/\/doi.org\/10.1145\/2635868.2635883","DOI":"10.1145\/2635868.2635883 10.1145\/2635868.2635883"},{"issue":"5","key":"10107_CR4","doi-asserted-by":"publisher","first-page":"22","DOI":"10.1109\/MS.2008.130","volume":"25","author":"N Ayewah","year":"2008","unstructured":"Ayewah N, Hovemeyer D, Morgenthaler JD, Penix J, Pugh W (2008) Using Static Analysis to Find Bugs. IEEE Software 25(5):22\u201329. https:\/\/doi.org\/10.1109\/MS.2008.130","journal-title":"IEEE Software"},{"key":"10107_CR5","doi-asserted-by":"publisher","unstructured":"Bader J, Scott A, Pradel M, Chandra S (2019) Getafix: Learning to Fix Bugs Automatically. Proceedings of the ACM on Programming Languages 3(OOPSLA) https:\/\/doi.org\/10.1145\/3360585","DOI":"10.1145\/3360585"},{"key":"10107_CR6","doi-asserted-by":"publisher","unstructured":"Bavishi R, Yoshida H, Prasad MR (2019) Phoenix: Automated Data-Driven Synthesis of Repairs for Static Analysis Violations. In: Proceedings of the 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC\/FSE \u201919), Association for Computing Machinery, New York, NY, USA, pp 613\u2013624, https:\/\/doi.org\/10.1145\/3338906.3338952","DOI":"10.1145\/3338906.3338952"},{"key":"10107_CR7","doi-asserted-by":"publisher","unstructured":"Beller M, Bholanath R, McIntosh S, Zaidman A (2016) Analyzing the State of Static Analysis: A Large-Scale Evaluation in Open Source Software. In: Proceedings of the 23rd IEEE International Conference on Software Analysis, Evolution, and Reengineering (SANER \u201916), IEEE, pp 470\u2013481 https:\/\/doi.org\/10.1109\/SANER.2016.105","DOI":"10.1109\/SANER.2016.105"},{"key":"10107_CR8","doi-asserted-by":"publisher","unstructured":"Beller M, Gousios G, Zaidman A (2017) Oops, My Tests Broke the Build: An Explorative Analysis of Travis CI with GitHub. In: Proceedings of the 14th International Conference on Mining Software Repositories (MSR \u201917), IEEE Press, pp 356\u2013367 https:\/\/doi.org\/10.1109\/MSR.2017.62","DOI":"10.1109\/MSR.2017.62"},{"key":"10107_CR9","doi-asserted-by":"publisher","unstructured":"Bhatia S, Kohli P, Singh R (2018) Neuro-Symbolic Program Corrector for Introductory Programming Assignments. In: Proceedings of the 40th International Conference on Software Engineering (ICSE \u201918), Association for Computing Machinery, New York, NY, USA, pp 60\u201370 https:\/\/doi.org\/10.1145\/3180155.3180219https:\/\/doi.org\/10.1145\/3180155.3180219","DOI":"10.1145\/3180155.3180219 10.1145\/3180155.3180219"},{"key":"10107_CR10","doi-asserted-by":"crossref","unstructured":"Calcagno C, Distefano D, Dubreil J, Gabi D, Hooimeijer P, Luca M, O\u2019Hearn P, Papakonstantinou I, Purbrick J, Rodriguez D (2015) Moving fast with software verification. In: Havelund K, Holzmann G, Joshi R (eds) NASA Formal Methods, Springer International Publishing, Cham, pp 3\u201311","DOI":"10.1007\/978-3-319-17524-9_1"},{"key":"10107_CR11","doi-asserted-by":"publisher","unstructured":"Carvalho A, Luz W, Marc\u00edlio D, Bonif\u00e1cio R, Pinto G, Canedo ED (2020) C-3PR: A Bot for Fixing Static Analysis Violations via Pull Requests. In: Proceedings of the 27th IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER \u201920), IEEE, pp 161\u2013171 https:\/\/doi.org\/10.1109\/SANER48275.2020.9054842","DOI":"10.1109\/SANER48275.2020.9054842"},{"key":"10107_CR12","unstructured":"CheckStyle-IDEA (2021) CheckStyle-IDEA. https:\/\/plugins.jetbrains.com\/plugin\/1065-checkstyle-idea, last access: 2020-07-13"},{"key":"10107_CR13","doi-asserted-by":"publisher","unstructured":"Chen Z, Kommrusch S, Tufano M, Pouchet LN, Poshyvanyk D, Monperrus M (2019) SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repair. IEEE Transactions on Software Engineering https:\/\/doi.org\/10.1109\/TSE.2019.2940179","DOI":"10.1109\/TSE.2019.2940179"},{"key":"10107_CR14","unstructured":"Dias H (2020) The anatomy of a perfect pull request: How does a good pull request look like. https:\/\/medium.com\/@hugooodias\/the-anatomy-of-a-perfect-pull-request-567382bb6067, last access: 2020-07-13"},{"key":"10107_CR15","doi-asserted-by":"crossref","unstructured":"Gupta R, Pal S, Kanade A, Shevade S (2017) DeepFix: Fixing Common C Language Errors by Deep Learning. In: Proceedings of the 31st AAAI Conference on Artificial Intelligence (AAAI \u201917), AAAI Press, pp 1345\u20131351","DOI":"10.1609\/aaai.v31i1.10742"},{"key":"10107_CR16","doi-asserted-by":"publisher","unstructured":"Just R, Jalali D, Ernst MD (2014) Defects4J: A Database of Existing Faults to Enable Controlled Testing Studies for Java Programs. In: Proceedings of the 2014 International Symposium on Software Testing and Analysis (ISSTA \u201914), Association for Computing Machinery, New York, NY, USA, pp 437\u2013440 https:\/\/doi.org\/10.1145\/2610384.2628055","DOI":"10.1145\/2610384.2628055"},{"key":"10107_CR17","doi-asserted-by":"publisher","unstructured":"Marcilio D, Bonif\u00e1cio R, Monteiro E, Canedo E, Luz W, Pinto G (2019) Are Static Analysis Violations Really Fixed? A Closer Look at Realistic Usage of SonarQube. In: Proceedings of the 27th International Conference on Program Comprehension (ICPC \u201919), IEEE Press, pp 209\u2013219 https:\/\/doi.org\/10.1109\/ICPC.2019.00040","DOI":"10.1109\/ICPC.2019.00040"},{"key":"10107_CR18","doi-asserted-by":"publisher","first-page":"110671","DOI":"10.1016\/j.jss.2020.110671","volume":"168","author":"D Marcilio","year":"2020","unstructured":"Marcilio D, Furia CA, Bonif\u00e1cio R, Pinto G (2020) SpongeBugs: Automatically generating fix suggestions in response to static code analysis warnings. Journal of Systems and Software 168:110671. https:\/\/doi.org\/10.1016\/j.jss.2020.110671https:\/\/doi.org\/10.1016\/j.jss.2020.110671. https:\/\/www.sciencedirect.com\/science\/article\/pii\/S016412122030128X","journal-title":"Journal of Systems and Software"},{"key":"10107_CR19","doi-asserted-by":"publisher","unstructured":"Markovtsev V, Long W, Mougard H, Slavnov K, Bulychev E (2019) STYLE-ANALYZER: fixing code style inconsistencies with interpretable unsupervised algorithms. In: Proceedings of the 16th International Conference on Mining Software Repositories (MSR \u201919), IEEE Press, pp 468\u2013478 https:\/\/doi.org\/10.1109\/MSR.2019.00073","DOI":"10.1109\/MSR.2019.00073"},{"key":"10107_CR20","doi-asserted-by":"publisher","unstructured":"Monperrus M (2018) Automatic Software Repair: A Bibliography. ACM Computing Surveys 51(1) https:\/\/doi.org\/10.1145\/3105906","DOI":"10.1145\/3105906"},{"key":"10107_CR21","doi-asserted-by":"publisher","unstructured":"Parr T, Vinju J (2016) Towards a Universal Code Formatter through Machine Learning. In: Proceedings of the 2016 ACM SIGPLAN International Conference on Software Language Engineering (SLE \u201916), Association for Computing Machinery, New York, NY, USA, pp 137\u2013151 https:\/\/doi.org\/10.1145\/2997364.2997383https:\/\/doi.org\/10.1145\/2997364.2997383","DOI":"10.1145\/2997364.2997383 10.1145\/2997364.2997383"},{"key":"10107_CR22","doi-asserted-by":"publisher","unstructured":"Prause CR, Jarke M (2015) Gamification for Enforcing Coding Conventions. In: Proceedings of the 10th Joint Meeting on Foundations of Software Engineering (ESEC\/FSE \u201915), Association for Computing Machinery, New York, NY, USA, pp 649\u2013660 https:\/\/doi.org\/10.1145\/2786805.2786806","DOI":"10.1145\/2786805.2786806"},{"key":"10107_CR23","doi-asserted-by":"publisher","unstructured":"Reiss SP (2007) Automatic Code Stylizing. In: Proceedings of the 22nd IEEE\/ACM International Conference on Automated Software Engineering (ASE \u201907), Association for Computing Machinery, New York, NY, USA. https:\/\/doi.org\/10.1145\/1321631.1321645, pp 74\u201383","DOI":"10.1145\/1321631.1321645"},{"key":"10107_CR24","doi-asserted-by":"publisher","unstructured":"Santos EA, Campbell JC, Patel D, Hindle A, Amaral JN (2018) Syntax and Sensibility: Using Language Models to Detect and Correct Syntax Errors. In: Proceedings of the 25th IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER \u201918), IEEE, pp 311\u2013322 https:\/\/doi.org\/10.1109\/SANER.2018.8330219","DOI":"10.1109\/SANER.2018.8330219"},{"key":"10107_CR25","doi-asserted-by":"publisher","unstructured":"Santos RMD, Gerosa MA (2018) Impacts of Coding Practices on Readability. In: Proceedings of the 26th International Conference on Program Comprehension (ICPC \u201918), Association for Computing Machinery, New York, NY, USA, pp 277\u2013285 https:\/\/doi.org\/10.1145\/3196321.3196342","DOI":"10.1145\/3196321.3196342"},{"issue":"2","key":"10107_CR26","doi-asserted-by":"publisher","first-page":"104","DOI":"10.1109\/MS.2011.31","volume":"28","author":"D Spinellis","year":"2011","unstructured":"Spinellis D (2011) elytS edoC. IEEE Software 28 (2):104. https:\/\/doi.org\/10.1109\/MS.2011.31","journal-title":"IEEE Software"},{"key":"10107_CR27","doi-asserted-by":"publisher","unstructured":"Tufano M, Watson C, Bavota G, Di Penta M, White M, Poshyvanyk D (2018) An Empirical Investigation into Learning Bug-Fixing Patches in the Wild via Neural Machine Translation. In: Proceedings of the 33rd ACM\/IEEE International Conference on Automated Software Engineering (ASE \u201918), Association for Computing Machinery, New York, NY, USA, pp 832\u2013837, https:\/\/doi.org\/10.1145\/3238147.3240732","DOI":"10.1145\/3238147.3240732"},{"key":"10107_CR28","doi-asserted-by":"publisher","unstructured":"Vassallo C, Panichella S, Palomba F, Proksch S, Zaidman A, Gall HC (2018) Context Is King: The Developer Perspective on the Usage of Static Analysis Tools. In: Proceedings of the 25th IEEE International Conference on Software Analysis, Evolution, and Reengineering (SANER \u201918), IEEE, pp 38\u201349 https:\/\/doi.org\/10.1109\/SANER.2018.8330195","DOI":"10.1109\/SANER.2018.8330195"},{"key":"10107_CR29","unstructured":"Yasunaga M, Liang P (2020) Graph-based Self-Supervised Program Repair from Diagnostic Feedback. In: International Conference on Machine Learning (ICML)"},{"key":"10107_CR30","doi-asserted-by":"publisher","unstructured":"Zampetti F, Scalabrino S, Oliveto R, Canfora G, Di Penta M (2017) How Open Source Projects use Static Code Analysis Tools in Continuous Integration Pipelines. In: Proceedings of the 14th International Conference on Mining Software Repositories (MSR \u201917), IEEE Press, pp 334\u2013344 https:\/\/doi.org\/10.1109\/MSR.2017.2","DOI":"10.1109\/MSR.2017.2"}],"container-title":["Empirical Software Engineering"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/link.springer.com\/content\/pdf\/10.1007\/s10664-021-10107-0.pdf","content-type":"application\/pdf","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/link.springer.com\/article\/10.1007\/s10664-021-10107-0\/fulltext.html","content-type":"text\/html","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/link.springer.com\/content\/pdf\/10.1007\/s10664-021-10107-0.pdf","content-type":"application\/pdf","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2022,9,26]],"date-time":"2022-09-26T08:27:48Z","timestamp":1664180868000},"score":1,"resource":{"primary":{"URL":"https:\/\/link.springer.com\/10.1007\/s10664-021-10107-0"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2022,8,6]]},"references-count":30,"journal-issue":{"issue":"6","published-print":{"date-parts":[[2022,11]]}},"alternative-id":["10107"],"URL":"https:\/\/doi.org\/10.1007\/s10664-021-10107-0","relation":{},"ISSN":["1382-3256","1573-7616"],"issn-type":[{"value":"1382-3256","type":"print"},{"value":"1573-7616","type":"electronic"}],"subject":[],"published":{"date-parts":[[2022,8,6]]},"assertion":[{"value":"24 September 2021","order":1,"name":"accepted","label":"Accepted","group":{"name":"ArticleHistory","label":"Article History"}},{"value":"6 August 2022","order":2,"name":"first_online","label":"First Online","group":{"name":"ArticleHistory","label":"Article History"}}],"article-number":"149"}}