Coder Social home page Coder Social logo

forestaa / vscode-spotless-gradle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from badsyntax/vscode-spotless-gradle

0.0 1.0 0.0 3.97 MB

A VS Code extension to lint & format your source files using Spotless & Gradle.

Home Page: https://marketplace.visualstudio.com/items?itemName=richardwillis.vscode-spotless-gradle

License: MIT License

TypeScript 97.79% Java 0.40% Groovy 0.22% CSS 0.03% JavaScript 1.39% Less 0.03% SCSS 0.03% C 0.02% C++ 0.03% MATLAB 0.02% Python 0.02%

vscode-spotless-gradle's Introduction

Spotless Gradle

Marketplace Version Visual Studio Marketplace Installs Build & Publish CodeQL GitHub bug issues

A VS Code extension to lint & format your code using Spotless (via Gradle).

Spotless Gradle Screencast

Features

  • Provides diagnostics to show invalid formatting (with quick fixes)
  • Provides a Spotless fixAll code action (Format on Save)
  • Provides a Spotless formatter (Format Document)

Supports all languages that Spotless supports.

Requirements

Usage

Before using this extension, ensure you've configured Spotless correctly in your Gradle build file. (Run ./gradlew spotlessDiagnose to prepare & validate Spotless.)

Enabling Spotless

Spotless formatting & diagnostics are disabled by default. Change the settings to adjust this behaviour:

{
  "[java]": {
    "spotlessGradle.format.enable": true,
    "spotlessGradle.diagnostics.enable": true
  }
}

Format on Save

{
  "[java]": {
    "editor.codeActionsOnSave": {
      "source.fixAll.spotlessGradle": true
    }
  }
}

Format Document

If there are multiple formatters for a language type, set Spotless to be the default:

{
  "[java]": {
    "editor.defaultFormatter": "richardwillis.vscode-spotless-gradle"
  }
}

Other Optional Settings

Disable other formatters to improve the performance, for example:

{
  "[java]": {
    "files.trimTrailingWhitespace": false
  }
}

How it Works

This extension runs the spotlessApply Gradle task on the focused file using the Spotless IDE hook feature. Untitled/Unsaved files are ignored.

The vscode => Spotless interface is provided by the Gradle Tasks extension.

๐Ÿ‘‰ Architecture Overview

Troubleshooting

View logs by selecting Spotless Gradle and/or Gradle Tasks in the output panel.

Support

Credits

Release Notes

See CHANGELOG.md.

License

See LICENSE.md.

vscode-spotless-gradle's People

Contributors

badsyntax avatar dependabot-preview[bot] avatar dependabot[bot] avatar snyk-bot avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.