p3c README

The project's README from github.com/alibaba/p3c. As one markdown file: README.md.

P3C

最新版本:黄山版(2022.2.3发布)

License

Preface

We are pleased to present Alibaba Java Coding Guidelines which consolidates the best programming practices over the years from Alibaba Group's technical teams. A vast number of Java programming teams impose demanding requirements on code quality across projects as we encourage reuse and better understanding of each other's programs. We have seen many programming problems in the past. For example, defective database table structures and index designs may cause software architecture flaws and performance risks. Another example is confusing code structures being difficult to maintain. Furthermore, vulnerable code without authentication is prone to hackers’ attacks. To address these kinds of problems, we developed this document for Java developers at Alibaba.

For more information please refer the Alibaba Java Coding Guidelines:

Introduction

The project consists of 3 parts:

Rules

Forty-nine rules are realized based on PMD, please refer the P3C-PMD documentation for more detailed information. Four rules are implemented within IDE plugins (IDEA and Eclipse) as follows:

p3c (alibaba/p3c)

Searching Database…

30.9K ·GitHub
What is this?Alibaba Java Coding Guidelines (P3C): Java coding rules distilled from the accumulated best practices of Alibaba Group's technical teams, shipped as PMD static-analysis rules and IDE plugins.
What exactly do I install — a rule set, a library, an app?Three parts: a PMD implementation of the rules for static analysis, an IntelliJ IDEA plugin, and an Eclipse plugin — so you can run checks in your analysis pipeline or get feedback right inside the IDE.
How do I get it running?Install the plugin in IntelliJ IDEA or Eclipse, or plug the P3C-PMD rule set into your PMD run; the README itself skips step-by-step install instructions and refers you to the P3C-PMD documentation for details.
What do I need to have before I can use it?A Java project to analyze; for the plugin route you need IntelliJ IDEA or Eclipse, and the PMD rules are used wherever you run PMD. No other prerequisites are listed in the README.
Do the tools enforce everything in the guidelines document?No — automated coverage is partial: 49 rules implemented in PMD plus 4 rules that exist only inside the IDEA and Eclipse plugins. Everything else in the guideline lives in the document itself, not in the tooling.
Is this only relevant for Alibaba-style codebases?Any Java team can use it — Alibaba wrote it for its own developers first, but the guideline addresses general Java quality problems rather than Alibaba-internal specifics.
What do the rules actually check?Classic Java pitfalls: using deprecated classes or methods, overriding a method without the @Override annotation, calling static members through an instance, and breaking the hashCode/equals contract for Set elements or Map keys. The sample rules are labeled [Mandatory] — hard prohibitions, not style suggestions.
Is the guideline itself available in English?Yes — the latest Chinese edition comes as a downloadable PDF (Huangshan edition), and an English version of the Alibaba Java Coding Guidelines is provided as well.
How fresh is the project?The latest guideline edition is Huangshan, released February 3, 2022 (2022.2.3).
Why did Alibaba build and open-source this?Their teams kept hitting the same issues — defective database table and index designs causing architecture flaws and performance risks, confusing code structures, and vulnerable unauthenticated code — so they codified years of internal best practice into one shared guideline.
Creator
alibaba
Size
26.5 MB
Stars
30.9K
Updated
CommitMay 11
Age
9y
Commits · 90 Days