Giter Club home page Giter Club logo

ecsls's Introduction

[ECSLS] Epitech Coding Style Language Server

image

Dependencies

Nix

  • Via Home Manager

Using Home Manager, you can use the github url as an input and pass it to your nvim config.

Set ecsls.packages.${conf.system}.default within the neovim.extraPackages option and refer to the neovim configuration after the dependencie section.

  • Development packages are provided throught nix develop.

Non-Nix

  • Install banana-vera package if existing, or you compile it by yourself.

Epitech Ruleset

You need to clone the repo of the coding style of EPITECH. If you do not have access to this repo, we are sorry but you will not be able to use this LSP, as it is required for this to run, and is internal to Epitech.

git submodules update --init --recursive

or

git clone https://github.com/Epitech/banana-coding-style-checker.git <path>

Setup ECSLS python package

(optional) Create a virtual environement (avoid polluting your python).

python -m venv venv

Install the package locally.

venv/bin/pip install .

Note If you are using virtual environments, don't forget to add the correct path for the command in your LSP config

Setup

To activate ecsls as a language server, you'll need to create a custom LSP in your editor.

Once it is done, you'll need to create a ecsls.toml to tell the LSP to run as it is quite heavy and can be annoying.

Neovim

To activate the language server using lspconfig, use the following configuration:

local lspconfig = require('lspconfig')
local configs = require('lspconfig.configs')

-- โ†“ Epitech C Style Checker
if not configs.ecsls then
  configs.ecsls = {
    default_config = {
      root_dir = lspconfig.util.root_pattern('.git', 'Makefile'),
      cmd = { 'ecsls_run' },
      autostart = true,
      name = 'ecsls',
      filetypes = { 'c', 'cpp', 'make' },
    },
  }
end
lspconfig.ecsls.setup({})

Emacs

(require 'lsp-mode)
(lsp-register-client
  (make-lsp-client :new-connection (lsp-stdio-connection '("ecsls_run"))
                   :major-modes '(c-mode c++-mode makefile-mode)
                   :server-id 'ecsls))

(add-hook 'c-mode-hook 'lsp)
(add-hook 'c++-mode-hook 'lsp)
(add-hook 'makefile-mode-hook 'lsp)

Change the ruleset path

Note If you want to use it globally, or if you wish to change the vera rules directory, change path in by using init_options.

init_options = {
  path = '/your/custom/path',
},

Warning The path must be valid and pointing to the epitech ruleset repository root.

path = ".../ls/banana"  # invalid
path = ".../ls/banana-coding-style-checker/vera"  # invalid too
path = ".../ls/banana-coding-style-checker"  # valid

To see a configuration in more details, consider reading my dotfiles.

ecsls's People

Contributors

drawbu avatar sigmanificient avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ecsls's Issues

Version mismatch with the official tooling

The latest Coding Style release is pinned as version 1.2 (ref a97bb704dd0d341128e05aaa016930e787d6bc31) while our tool uses the master master. Need to implement a way to able "master" / "stable" warrning by Adding a second runner.

C-G8 need grouping

Just like C-F4, C-G8 need grouping

Thanksfully the implementation is quite generic

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.