Coder Social home page Coder Social logo

cleanthat's Introduction

CleanThat

Motivation

The point of this project is to enable automatic cleaning of your code-base. Some excellent maven plugin exists (e.g. )

Related projects:

Compatibility

Cleanthat is currently compatible with the following languages:

  • java

Installation

If your repository is hosted on Github.com:

https://github.com/marketplace/cleanthat/

Last considerations

This software is provided WITHOUT ANY WARRANTY, and is available under the Apache License, Version 2. Any code loss caused by using this plugin is not the responsibility of the author(s). Be sure to use some source repository management system such as GIT before using this plugin.

Contributions are welcome.

Configuration

CleanThat is configured through a cleanthat.json file at the root of the repository.

Here is an example configuration:

syntax_version: "2021-08-02"
meta:
  labels:
  - "cleanthat"
  refs:
    branches:
    - "refs/heads/develop"
    - "refs/heads/main"
    - "refs/heads/master"
source_code:
  excludes:
  - "regex:.*/generated/.*"
  encoding: "UTF-8"
  line_ending: "LF"
languages:
- language: "java"
  language_version: "11"
  source_code:
    includes:
    - "regex:.*\\.java"
  processors:
  - engine: "rules"
    parameters:
      production_ready_only: true
  - engine: "revelc_imports"
    parameters:
      # Organize imports like in Eclipse
      remove_unused: true
      groups: "java.,javax.,org.,com."
      static_groups: "java,*"
  # Use Spring formatting convention
  - engine: "spring_formatter"
    parameters: {}

Using Eclipse Formatter

An alternative to spring_formatter is eclipse_formatter. It takes as parameter an url like:

A public http(s) URL:

https://raw.githubusercontent.com/solven-eu/pepper/master/static/src/main/resources/eclipse/eclipse_java_code_formatter.xml

A file in local repository (root being assumed based on Git root/Maven top module)

code:/static/src/main/resources/eclipse/eclipse_java_code_formatter.xml

Eclipse Stylesheets can exported to XML through:

  • Go into Preferences
  • Select Java > Code Style > Formatter
  • Click on 'Export All'

CleanThat will accept only configuration with a single profile in them. If multiple profiles are found, we will rely on the first profile.

Deploy into Production (AWS):

git push origin master:deploy-prd

Release a new version (and deploy jars to Sonatype m2central):

mvn release:clean release:prepare release:perform

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.