Skip to content

CI #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

CI #39

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
makem.sh linguist-vendored
72 changes: 72 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# * test.yml --- Test Emacs packages using makem.sh on GitHub Actions

# https://github.com/alphapapa/makem.sh

# Based on Steve Purcell's examples at
# <https://github.com/purcell/setup-emacs/blob/master/.github/workflows/test.yml>,
# <https://github.com/purcell/package-lint/blob/master/.github/workflows/test.yml>.

# * License:

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

# * Code:

name: "CI"
on:
pull_request:
push:
# Comment out this section to enable testing of all branches.
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
emacs_version:
- 26.3
- 27.1
- snapshot
steps:
- uses: purcell/setup-emacs@master
with:
version: ${{ matrix.emacs_version }}

- uses: actions/checkout@v2

- name: Initialize sandbox
run: |
SANDBOX_DIR=$(mktemp -d) || exit 1
echo ::set-env name=SANDBOX_DIR::$SANDBOX_DIR
./makem.sh -vv --sandbox=$SANDBOX_DIR --install-deps --install-linters

# The "all" rule is not used, because it treats compilation warnings
# as failures, so linting and testing are run as separate steps.

- name: Lint
# NOTE: Uncomment this line to treat lint failures as passing
# so the job doesn't show failure.
# continue-on-error: true
run: ./makem.sh -vv --sandbox=$SANDBOX_DIR lint

- name: Test
if: always() # Run test even if linting fails.
run: ./makem.sh -vv --sandbox=$SANDBOX_DIR test

# Local Variables:
# eval: (outline-minor-mode)
# End:
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.elc
56 changes: 56 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# * makem.sh/Makefile --- Script to aid building and testing Emacs Lisp packages

# This Makefile is from the makem.sh repo: <https://github.com/alphapapa/makem.sh>.

# * Arguments

# For consistency, we use only var=val options, not hyphen-prefixed options.

# NOTE: I don't like duplicating the arguments here and in makem.sh,
# but I haven't been able to find a way to pass arguments which
# conflict with Make's own arguments through Make to the script.
# Using -- doesn't seem to do it.

ifdef install-deps
INSTALL_DEPS = "--install-deps"
endif
ifdef install-linters
INSTALL_LINTERS = "--install-linters"
endif

ifdef sandbox
ifeq ($(sandbox), t)
SANDBOX = --sandbox
else
SANDBOX = --sandbox=$(sandbox)
endif
endif

ifdef debug
DEBUG = "--debug"
endif

# ** Verbosity

# Since the "-v" in "make -v" gets intercepted by Make itself, we have
# to use a variable.

verbose = $(v)

ifneq (,$(findstring vv,$(verbose)))
VERBOSE = "-vv"
else ifneq (,$(findstring v,$(verbose)))
VERBOSE = "-v"
endif

# * Rules

# TODO: Handle cases in which "test" or "tests" are called and a
# directory by that name exists, which can confuse Make.

%:
@./makem.sh $(DEBUG) $(VERBOSE) $(SANDBOX) $(INSTALL_DEPS) $(INSTALL_LINTERS) $(@)

.DEFAULT: init
init:
@./makem.sh $(DEBUG) $(VERBOSE) $(SANDBOX) $(INSTALL_DEPS) $(INSTALL_LINTERS)
8 changes: 7 additions & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ AOT compile LanguageServer.jl into your julia image. Something like:
See the documentation on PackageCompiler.jl for further usage details.

*** Installing =lsp-julia=

**** quelpa
It's currently easiest to install this package with quelpa. I'll see
about getting this added to melpa soon enough.

Expand All @@ -54,6 +54,12 @@ about getting this added to melpa soon enough.
:repo "non-Jedi/lsp-julia"
:files (:defaults "languageserver")))
#+END_SRC
**** use-package
#+BEGIN_SRC emacs-lisp
(use-package lsp-julia
:config
(setq lsp-julia-default-environment "~/.julia/environments/v1.5"))
#+END_SRC

*** Using =lsp-julia= with a julia major mode

Expand Down
38 changes: 19 additions & 19 deletions lsp-julia.el
Original file line number Diff line number Diff line change
Expand Up @@ -158,28 +158,27 @@ Set to nil if you want to use the globally installed versions."
:group 'lsp-julia)

(defcustom lsp-julia-lint-missingrefs "all"
"Highlight unknown symbols. The `symbols` option will not mark
unknown fields."
"Highlight unknown symbols.
The `symbols` option will not mark unknown fields."
:type 'string
:options '("none" "symbols" "all")
:group 'lsp-julia)

(defcustom lsp-julia-lint-call t
"This compares call signatures against all known methods for
the called function. Calls with too many or too few arguments, or
"Compares call signatures against all known methods for the called function.
Calls with too many or too few arguments, or
unknown keyword parameters are highlighted."
:type 'boolean
:group 'lsp-julia)

(defcustom lsp-julia-lint-iter t
"Check iterator syntax of loops. Will identify, for example,
attempts to iterate over single values."
"Check iterator syntax of loops.
Will identify, for example, attempts to iterate over single values."
:type 'boolean
:group 'lsp-julia)

(defcustom lsp-julia-lint-constif t
"Check for constant conditionals in if statements that result
in branches never being reached.."
"Check for constant conditionals in if statements that result in branches never being reached."
:type 'boolean
:group 'lsp-julia)

Expand All @@ -194,8 +193,7 @@ in branches never being reached.."
:group 'lsp-julia)

(defcustom lsp-julia-lint-typeparam t
"Check parameters declared in `where` statements or datatype
declarations are used."
"Check parameters declared in `where` statements or datatype declarations are used."
:type 'boolean
:group 'lsp-julia)

Expand All @@ -205,21 +203,20 @@ declarations are used."
:group 'lsp-julia)

(defcustom lsp-julia-lint-pirates t
"Check for type piracy - the overloading of external functions
with methods specified for external datatypes. 'External' here
refers to imported code."
"Check for type piracy.
the overloading of external functions
with methods specified for external datatypes.
'External' here refers to imported code."
:type 'boolean
:group 'lsp-julia)

(defcustom lsp-julia-lint-useoffuncargs t
"Check that all declared arguments are used within the function
body."
"Check that all declared arguments are used within the function body."
:type 'boolean
:group 'lsp-julia)

(defcustom lsp-julia-lint-nothingcomp t
"Check for use of `==` rather than `===` when comparing against
`nothing`."
"Check for use of `==` rather than `===` when comparing against `nothing`."
:type 'boolean
:group 'lsp-julia)

Expand Down Expand Up @@ -264,8 +261,7 @@ body."
(concat "\"" dp2 "\"")))

(defun lsp-julia--symbol-server-store-path-to-jl ()
"Convert the variable `lsp-julia-symbol-server-store-path' to a
string or \"nothing\" if `nil'"
"Convert the variable `lsp-julia-symbol-server-store-path' to a string or \"nothing\" if nil."
(if lsp-julia-symbol-server-store-path
(let ((sssp (expand-file-name lsp-julia-symbol-server-store-path)))
(make-directory sssp t)
Expand Down Expand Up @@ -298,4 +294,8 @@ body."
:multi-root t))

(provide 'lsp-julia)

;;; ISPELL Local values
;;; LocalWords: julia linter datatypes submodule lauch boolean whitespace

;;; lsp-julia.el ends here
Loading