Skip to main content
eScholarship
Open Access Publications from the University of California

UC Irvine

UC Irvine Electronic Theses and Dissertations bannerUC Irvine

LLMs for Code Style Analysis an Exploratory Study for Integrating Style Linters with LLMs

Abstract

Recent advances in Large Language Models (LLMs) have opened new horizons, especially in code quality. This paper explores the capabilities of LLMs, such as the GPT-4 model, to identify and enforce code style. We compare LLMs to state-of-the-art linters in Python and Java, feeding them Python and Java code samples with various style deviations and analyzing their performance. The findings reveal a high potential for these tools to be used complementarily. Linters demonstrated strength in identifying well-defined, rule-based formatting guidelines, and LLMs identified higher-level, more conceptual violations, that required an understanding of the code or the guideline.