[](https://app.circleci.com/pipelines/github/hanggrian/rulebook/)
[](https://app.codecov.io/gh/hanggrian/rulebook/) \
[](https://repo1.maven.org/maven2/com/hanggrian/rulebook/rulebook-ktlint/)
[](https://openjdk.java.net/projects/jdk8/) \
[](https://pypi.org/project/rulebook-pylint/)
[](https://test.pypi.org/project/rulebook-pylint/)
[](https://www.python.org/download/releases/3.0/)
# Rulebook
Third-party rules for JVM and Python lint tools, meant to be used in conjunction
with official ones. Most of the rules are opinionated personal code styles.
However, some already exists in other linters, providing the same experience
across multiple languages.
Language | Linter | Variants
--- | --- | ---
Kotlin | [Ktlint](https://pinterest.github.io/ktlint/) | [Ktlint Style](https://pinterest.github.io/ktlint/1.0.1/rules/code-styles/)
Java | [Checkstyle](https://checkstyle.org/) | [Sun Style](https://checkstyle.sourceforge.io/sun_style.html) or [Google Java Style](https://google.github.io/styleguide/javaguide.html)
Groovy | [CodeNarc](https://codenarc.org/) | [Groovy Style](https://groovy-lang.org/style-guide.html)
Python | [Pylint](https://pylint.org/) | [Pylint Style](https://pylint.pycqa.org/en/latest/user_guide/configuration/all-options.html) or [Google Python Style](https://google.github.io/styleguide/pyguide.html)
[View all rules](https://github.com/hanggrian/rulebook/wiki/)
## Download
### Maven
```gradle
repositories {
mavenCentral()
}
dependencies {
ktlint "com.hanggrian.rulebook:rulebook-ktlint:$version"
checkstyle "com.hanggrian.rulebook:rulebook-checkstyle:$version"
codenarc "com.hanggrian.rulebook:rulebook-codenarc:$version"
}
```
### PyPI
```sh
pip install pylint regex rulebook-pylint
```
## Usage
### Ktlint
- Apply [Ktlint Integration](https://pinterest.github.io/ktlint/0.49.1/install/integrations/#custom-gradle-integration)
to Gradle project.
- Using configuration `ktlint`, add this project as dependency.
```gradle
configurations {
ktlint
}
dependencies {
ktlint "com.hanggrian.rulebook:rulebook-ktlint:$libraryVersion"
}
// the rest of ktlint tasks' configuration
```
### Checkstyle
- Apply [Checkstyle Gradle Plugin](https://docs.gradle.org/current/userguide/checkstyle_plugin.html).
- Using configuration `checkstyle`, add this project as dependency.
- Point to local config file or put in `/config/checkstyle/codenarc.xml`.
```gradle
plugins {
checkstyle
}
checkstyle {
toolVersion "$checkstyleVersion"
configFile "path/to/rulebook_checkstyle.xml"
}
dependencies {
checkstyle "com.hanggrian.rulebook:rulebook-checkstyle:$libraryVersion"
}
```
### CodeNarc
- Apply [CodeNarc Gradle Plugin](https://docs.gradle.org/current/userguide/codenarc_plugin.html).
- Using configuration `codenarc`, add this project as dependency.
- Point to local config file or put in `/config/codenarc/codenarc.xml`.
```gradle
plugins {
codenarc
}
codenarc {
toolVersion "$codenarcVersion"
configFile "path/to/rulebook_codenarc.xml"
}
dependencies {
codenarc "com.hanggrian.rulebook:rulebook-codenarc:$libraryVersion"
}
```
### Pylint
- Point config file to local `pylintrc`.
## First time installation
Presuming the IDE is *IntelliJ IDEA* or *PyCharm*, consider applying the linter
style to it.
### Ktlint
Explained in [Ktlint IntelliJ IDEA Configuration](https://pinterest.github.io/ktlint/0.49.1/rules/configuration-intellij-idea/),
using standard [Kotlin coding conventions](https://kotlinlang.org/docs/coding-conventions.html)
is enough:
- In **File > Settings > Editor > Code Style > Kotlin**, set from
**Kotlin style guide**.
- Append `kotlin.code.style=official` to root `gradle.properties`.
### Checkstyle
Explained in [Google Java Format](https://github.com/google/google-java-format/):
- In **File > Settings > Editor > Code Style > Java**, import
[IntelliJ Java Google Style file](https://raw.githubusercontent.com/google/styleguide/gh-pages/intellij-java-google-style.xml).
### Pylint
Apply few changes in settings:
- In **File > Settings > Editor > Code Style > Python > Blank Lines**:
- Set **After local imports** and **Before the first method** to **0**.
- Set the rest to **1**.
Raw data
{
"_id": null,
"home_page": null,
"name": "rulebook-pylint",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "lint rules, lint checkers",
"author": null,
"author_email": "Hendra Anggrian <hanggrian@proton.me>",
"download_url": "https://files.pythonhosted.org/packages/12/9b/4e4c4ee23e8b288897458c6f7573856f3c19669a075e5d2cc82733e84b49/rulebook_pylint-0.1.tar.gz",
"platform": null,
"description": "[](https://app.circleci.com/pipelines/github/hanggrian/rulebook/)\n[](https://app.codecov.io/gh/hanggrian/rulebook/) \\\n[](https://repo1.maven.org/maven2/com/hanggrian/rulebook/rulebook-ktlint/)\n[](https://openjdk.java.net/projects/jdk8/) \\\n[](https://pypi.org/project/rulebook-pylint/)\n[](https://test.pypi.org/project/rulebook-pylint/)\n[](https://www.python.org/download/releases/3.0/)\n\n# Rulebook\n\nThird-party rules for JVM and Python lint tools, meant to be used in conjunction\nwith official ones. Most of the rules are opinionated personal code styles.\nHowever, some already exists in other linters, providing the same experience\nacross multiple languages.\n\nLanguage | Linter | Variants\n--- | --- | ---\nKotlin | [Ktlint](https://pinterest.github.io/ktlint/) | [Ktlint Style](https://pinterest.github.io/ktlint/1.0.1/rules/code-styles/)\nJava | [Checkstyle](https://checkstyle.org/) | [Sun Style](https://checkstyle.sourceforge.io/sun_style.html) or [Google Java Style](https://google.github.io/styleguide/javaguide.html)\nGroovy | [CodeNarc](https://codenarc.org/) | [Groovy Style](https://groovy-lang.org/style-guide.html)\nPython | [Pylint](https://pylint.org/) | [Pylint Style](https://pylint.pycqa.org/en/latest/user_guide/configuration/all-options.html) or [Google Python Style](https://google.github.io/styleguide/pyguide.html)\n\n[View all rules](https://github.com/hanggrian/rulebook/wiki/)\n\n## Download\n\n### Maven\n\n```gradle\nrepositories {\n mavenCentral()\n}\n\ndependencies {\n ktlint \"com.hanggrian.rulebook:rulebook-ktlint:$version\"\n checkstyle \"com.hanggrian.rulebook:rulebook-checkstyle:$version\"\n codenarc \"com.hanggrian.rulebook:rulebook-codenarc:$version\"\n}\n```\n\n### PyPI\n\n```sh\npip install pylint regex rulebook-pylint\n```\n\n## Usage\n\n### Ktlint\n\n- Apply [Ktlint Integration](https://pinterest.github.io/ktlint/0.49.1/install/integrations/#custom-gradle-integration)\n to Gradle project.\n- Using configuration `ktlint`, add this project as dependency.\n\n```gradle\nconfigurations {\n ktlint\n}\n\ndependencies {\n ktlint \"com.hanggrian.rulebook:rulebook-ktlint:$libraryVersion\"\n}\n\n// the rest of ktlint tasks' configuration\n```\n\n### Checkstyle\n\n- Apply [Checkstyle Gradle Plugin](https://docs.gradle.org/current/userguide/checkstyle_plugin.html).\n- Using configuration `checkstyle`, add this project as dependency.\n- Point to local config file or put in `/config/checkstyle/codenarc.xml`.\n\n```gradle\nplugins {\n checkstyle\n}\n\ncheckstyle {\n toolVersion \"$checkstyleVersion\"\n configFile \"path/to/rulebook_checkstyle.xml\"\n}\n\ndependencies {\n checkstyle \"com.hanggrian.rulebook:rulebook-checkstyle:$libraryVersion\"\n}\n```\n\n### CodeNarc\n\n- Apply [CodeNarc Gradle Plugin](https://docs.gradle.org/current/userguide/codenarc_plugin.html).\n- Using configuration `codenarc`, add this project as dependency.\n- Point to local config file or put in `/config/codenarc/codenarc.xml`.\n\n```gradle\nplugins {\n codenarc\n}\n\ncodenarc {\n toolVersion \"$codenarcVersion\"\n configFile \"path/to/rulebook_codenarc.xml\"\n}\n\ndependencies {\n codenarc \"com.hanggrian.rulebook:rulebook-codenarc:$libraryVersion\"\n}\n```\n\n### Pylint\n\n- Point config file to local `pylintrc`.\n\n## First time installation\n\nPresuming the IDE is *IntelliJ IDEA* or *PyCharm*, consider applying the linter\nstyle to it.\n\n### Ktlint\n\nExplained in [Ktlint IntelliJ IDEA Configuration](https://pinterest.github.io/ktlint/0.49.1/rules/configuration-intellij-idea/),\nusing standard [Kotlin coding conventions](https://kotlinlang.org/docs/coding-conventions.html)\nis enough:\n\n- In **File > Settings > Editor > Code Style > Kotlin**, set from\n **Kotlin style guide**.\n- Append `kotlin.code.style=official` to root `gradle.properties`.\n\n### Checkstyle\n\nExplained in [Google Java Format](https://github.com/google/google-java-format/):\n\n- In **File > Settings > Editor > Code Style > Java**, import\n [IntelliJ Java Google Style file](https://raw.githubusercontent.com/google/styleguide/gh-pages/intellij-java-google-style.xml).\n\n### Pylint\n\nApply few changes in settings:\n\n- In **File > Settings > Editor > Code Style > Python > Blank Lines**:\n - Set **After local imports** and **Before the first method** to **0**.\n - Set the rest to **1**.\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Extended lint rules for JVM and Python",
"version": "0.1",
"project_urls": {
"Bug Tracker": "https://github.com/hanggrian/rulebook/issues",
"Source Code": "https://github.com/hanggrian/rulebook"
},
"split_keywords": [
"lint rules",
" lint checkers"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e6875a89428bd2e6bc6ea58f6191b612e88e446811e3c8464f448513f520d83c",
"md5": "22b4617c5ea148f0b6a3b44822f00756",
"sha256": "3846494726f97f153f087d86b296ce0c3d55277bdcb5e7e4baae8fcfb2b74cf7"
},
"downloads": -1,
"filename": "rulebook_pylint-0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "22b4617c5ea148f0b6a3b44822f00756",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 39663,
"upload_time": "2024-07-30T22:17:29",
"upload_time_iso_8601": "2024-07-30T22:17:29.502478Z",
"url": "https://files.pythonhosted.org/packages/e6/87/5a89428bd2e6bc6ea58f6191b612e88e446811e3c8464f448513f520d83c/rulebook_pylint-0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "129b4e4c4ee23e8b288897458c6f7573856f3c19669a075e5d2cc82733e84b49",
"md5": "fe5216b3c5073d9ceaa2f69225ccc97c",
"sha256": "1c87a8cccd435c5b4a56eddc48451b5f595c62905f51a16b72951f8ac01f0a2a"
},
"downloads": -1,
"filename": "rulebook_pylint-0.1.tar.gz",
"has_sig": false,
"md5_digest": "fe5216b3c5073d9ceaa2f69225ccc97c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 25592,
"upload_time": "2024-07-30T22:17:31",
"upload_time_iso_8601": "2024-07-30T22:17:31.383107Z",
"url": "https://files.pythonhosted.org/packages/12/9b/4e4c4ee23e8b288897458c6f7573856f3c19669a075e5d2cc82733e84b49/rulebook_pylint-0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-30 22:17:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hanggrian",
"github_project": "rulebook",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"circle": true,
"requirements": [],
"lcname": "rulebook-pylint"
}