Git Product home page Git Product logo

ensao-lint's Introduction

java linter

Le but de ce mini-projet est de créer un linter sous java. Définition du linter : Wikipedia

Travail à faire

Implémenter les règles suivantes :

Identifiant Niveau Description
LINT_REG_000 BLOCKER Les erreurs de syntaxe ne sont pas autorisées
LINT_REG_001 MEDIUM Les imports non utilisés sont à supprimer
LINT_REG_002 HIGHEST Les types java (class, interface, annotation, enum) commence par une majuscule, elles ne doivent pas avoir des sous-tirets _
LINT_REG_004 HIGH Les attributs d'une classe commencent par une minuscule
LINT_REG_006 HIGHEST Les expressions booléennes ne doivent avoir plus que 2 opérandes
LINT_REG_008 HIGHEST Le corps d'une méthode ne doit pas dépasser 30 lignes
LINT_REG_011 HIGHEST Le nombre de méthodes ne doit pas dépasser 20 méthodes déclarées par classe
LINT_REG_013 HIGHEST Les attributs de classe doivent avoir une visibilité déclarée

Si une règle est bloquante, alors remonter l'erreur est mettre fin à l'analyse du fichier en cours.

INPUT :

Le format d'entrée est une liste de fichiers .java et/ou des dossiers contenant des fichiers .java

OUTPUT :

Le résultat de l'analyse est écrit sur un fichier selon le type choisi par l'utilisateur : CSV, JSON, HTML et Markdown.

Exemple de résultat brut :

LEVEL    RULE    	    DESCRIPTION
MEDIUM [LINT_REG_001] Unused import 'java.util.List' at 'D:\0001_PERSO\0003_CODE\ensao-lint\testFiles\normalExecution\Example.java:1'
MEDIUM [LINT_REG_001] Unused import 'com.github.javaparser.ast.ImportDeclaration' at 'D:\0001_PERSO\0003_CODE\ensao-lint\testFiles\normalExecution\Example.java:2'
MEDIUM [LINT_REG_001] Unused import 'FFFF' at 'D:\0001_PERSO\0003_CODE\ensao-lint\testFiles\normalExecution\Example2.java:4'
MEDIUM [LINT_REG_001] Unused import 'org.apache.commons.lang3.StringUtils' at 'D:\0001_PERSO\0003_CODE\ensao-lint\testFiles\staticCall\StaticCallExample.java:1'
MEDIUM [LINT_REG_001] Unused import 'example.Access' at 'D:\0001_PERSO\0003_CODE\ensao-lint\testFiles\staticCall\StaticCallExample.java:2'
MEDIUM [LINT_REG_001] Unused import 'org.apache.commons.lang3.StringUtils' at 'D:\0001_PERSO\0003_CODE\ensao-lint\testFiles\staticCall\StaticCallExample.java:1'
MEDIUM [LINT_REG_001] Unused import 'example.Access' at 'D:\0001_PERSO\0003_CODE\ensao-lint\testFiles\staticCall\StaticCallExample.java:2'

Soumission de votre travail

Procéder par un fork de ce répo, ensuite préparer un pull request vers le même répo.

Grille de notation

Elément Pondération
Implémentation des règles 25%
Utilisation des instructions java ≥ 8 20%
Tests et couvertures 20%
Qualité du code 20%
Application des design patterns 10%
Documentation des règles 5%

NB

LINT_REG_000 et LINT_REG_001 sont partiellement implémentées.

Annexes

  1. Utiliser maven pour exécuter les tests unitaires :
mvn clean test
  1. le plugin jacoco est intégré et est configuré pour être exécuté pendant la phase de test, il permet d'établir le taux de la couverture des tests. Une fois le rapport est établi, vous pouvez le consulter sur target/site/jacoco/index.html

ensao-lint's People

Contributors

gilgamesh1302 avatar belmomusta 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.