branch: elpa/flymake-collection commit 9234e049dfb4ff80fa91dd3ce89f81dcde91e0a9 Author: Mohsin Kaleem <mohk...@kisara.moe> Commit: Mohsin Kaleem <mohk...@kisara.moe>
(refactor): Cleanup all code and documentation + Added some license headers to all the code files. + Fixed some small bugs and added some autoloads. + Expanded on incomplete docstrings for the package. --- checkers/flymake-rest-awk-gawk.el | 20 +++++++++++ checkers/flymake-rest-clang.el | 20 +++++++++++ checkers/flymake-rest-eslint.el | 20 +++++++++++ checkers/flymake-rest-gcc.el | 20 +++++++++++ checkers/flymake-rest-html-tidy.el | 20 +++++++++++ checkers/flymake-rest-jq.el | 20 +++++++++++ checkers/flymake-rest-jsonlint.el | 20 +++++++++++ checkers/flymake-rest-less.el | 20 +++++++++++ checkers/flymake-rest-markdownlint.el | 20 +++++++++++ checkers/flymake-rest-mypy.el | 20 +++++++++++ checkers/flymake-rest-proselint.el | 20 +++++++++++ checkers/flymake-rest-pycodestyle.el | 24 ++++++++++++-- checkers/flymake-rest-pylint.el | 20 +++++++++++ checkers/flymake-rest-rubocop.el | 20 +++++++++++ checkers/flymake-rest-shellcheck.el | 20 +++++++++++ checkers/flymake-rest-yamllint.el | 20 +++++++++++ flymake-rest-define.el | 42 ++++++++++++++++++++---- flymake-rest-hook-use-package.el | 26 +++++++++++++++ flymake-rest-hook.el | 28 ++++++++++++++-- flymake-rest-parse-enumerate.el | 27 +++++++++++++-- flymake-rest-parse-rx.el | 62 +++++++++++++++++++++++++++++------ flymake-rest.el | 5 +-- 22 files changed, 486 insertions(+), 28 deletions(-) diff --git a/checkers/flymake-rest-awk-gawk.el b/checkers/flymake-rest-awk-gawk.el index b5b22ecbe7..239a70585d 100644 --- a/checkers/flymake-rest-awk-gawk.el +++ b/checkers/flymake-rest-awk-gawk.el @@ -1,5 +1,25 @@ ;;; flymake-rest-awk-gawk.el --- awk/gawk diagnostic function -*- lexical-binding: t -*- +;; Copyright (c) 2021 Mohsin Kaleem + +;; Permission is hereby granted, free of charge, to any person obtaining a copy +;; of this software and associated documentation files (the "Software"), to deal +;; in the Software without restriction, including without limitation the rights +;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +;; copies of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: + +;; The above copyright notice and this permission notice shall be included in all +;; copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;; SOFTWARE. + ;;; Code: (require 'flymake) diff --git a/checkers/flymake-rest-clang.el b/checkers/flymake-rest-clang.el index 80fa326446..40a1568a83 100644 --- a/checkers/flymake-rest-clang.el +++ b/checkers/flymake-rest-clang.el @@ -1,5 +1,25 @@ ;;; flymake-rest-clang.el --- Clang diagnostic function -*- lexical-binding: t -*- +;; Copyright (c) 2021 Mohsin Kaleem + +;; Permission is hereby granted, free of charge, to any person obtaining a copy +;; of this software and associated documentation files (the "Software"), to deal +;; in the Software without restriction, including without limitation the rights +;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +;; copies of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: + +;; The above copyright notice and this permission notice shall be included in all +;; copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;; SOFTWARE. + ;;; Code: (require 'flymake) diff --git a/checkers/flymake-rest-eslint.el b/checkers/flymake-rest-eslint.el index f2f713ce74..d37ea6d9dd 100644 --- a/checkers/flymake-rest-eslint.el +++ b/checkers/flymake-rest-eslint.el @@ -1,5 +1,25 @@ ;;; flymake-rest-eslint.el --- ESLint diagnostic function -*- lexical-binding: t -*- +;; Copyright (c) 2021 Mohsin Kaleem + +;; Permission is hereby granted, free of charge, to any person obtaining a copy +;; of this software and associated documentation files (the "Software"), to deal +;; in the Software without restriction, including without limitation the rights +;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +;; copies of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: + +;; The above copyright notice and this permission notice shall be included in all +;; copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;; SOFTWARE. + ;;; Code: (require 'flymake) diff --git a/checkers/flymake-rest-gcc.el b/checkers/flymake-rest-gcc.el index f17f39004b..d7d2a3caaa 100644 --- a/checkers/flymake-rest-gcc.el +++ b/checkers/flymake-rest-gcc.el @@ -1,5 +1,25 @@ ;;; flymake-rest-gcc.el --- GCC diagnostic function -*- lexical-binding: t -*- +;; Copyright (c) 2021 Mohsin Kaleem + +;; Permission is hereby granted, free of charge, to any person obtaining a copy +;; of this software and associated documentation files (the "Software"), to deal +;; in the Software without restriction, including without limitation the rights +;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +;; copies of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: + +;; The above copyright notice and this permission notice shall be included in all +;; copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;; SOFTWARE. + ;;; Code: (require 'flymake) diff --git a/checkers/flymake-rest-html-tidy.el b/checkers/flymake-rest-html-tidy.el index 34531749bc..83e83f1226 100644 --- a/checkers/flymake-rest-html-tidy.el +++ b/checkers/flymake-rest-html-tidy.el @@ -1,5 +1,25 @@ ;;; flymake-rest-html-tidy.el --- Tidy-HTML5 diagnostic function -*- lexical-binding: t -*- +;; Copyright (c) 2021 Mohsin Kaleem + +;; Permission is hereby granted, free of charge, to any person obtaining a copy +;; of this software and associated documentation files (the "Software"), to deal +;; in the Software without restriction, including without limitation the rights +;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +;; copies of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: + +;; The above copyright notice and this permission notice shall be included in all +;; copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;; SOFTWARE. + ;;; Code: (require 'flymake) diff --git a/checkers/flymake-rest-jq.el b/checkers/flymake-rest-jq.el index 9b26a86f73..53c05e492e 100644 --- a/checkers/flymake-rest-jq.el +++ b/checkers/flymake-rest-jq.el @@ -1,5 +1,25 @@ ;;; flymake-rest-jq.el --- jq diagnostic function -*- lexical-binding: t -*- +;; Copyright (c) 2021 Mohsin Kaleem + +;; Permission is hereby granted, free of charge, to any person obtaining a copy +;; of this software and associated documentation files (the "Software"), to deal +;; in the Software without restriction, including without limitation the rights +;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +;; copies of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: + +;; The above copyright notice and this permission notice shall be included in all +;; copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;; SOFTWARE. + ;;; Code: (require 'flymake) diff --git a/checkers/flymake-rest-jsonlint.el b/checkers/flymake-rest-jsonlint.el index ee9144a1c0..746a0569a5 100644 --- a/checkers/flymake-rest-jsonlint.el +++ b/checkers/flymake-rest-jsonlint.el @@ -1,5 +1,25 @@ ;;; flymake-rest-jsonlint.el --- JSONLint diagnostic function -*- lexical-binding: t -*- +;; Copyright (c) 2021 Mohsin Kaleem + +;; Permission is hereby granted, free of charge, to any person obtaining a copy +;; of this software and associated documentation files (the "Software"), to deal +;; in the Software without restriction, including without limitation the rights +;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +;; copies of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: + +;; The above copyright notice and this permission notice shall be included in all +;; copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;; SOFTWARE. + ;;; Code: (require 'flymake) diff --git a/checkers/flymake-rest-less.el b/checkers/flymake-rest-less.el index e04934212d..76e86352ad 100644 --- a/checkers/flymake-rest-less.el +++ b/checkers/flymake-rest-less.el @@ -1,5 +1,25 @@ ;;; flymake-rest-less.el --- Less diagnostic function -*- lexical-binding: t -*- +;; Copyright (c) 2021 Mohsin Kaleem + +;; Permission is hereby granted, free of charge, to any person obtaining a copy +;; of this software and associated documentation files (the "Software"), to deal +;; in the Software without restriction, including without limitation the rights +;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +;; copies of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: + +;; The above copyright notice and this permission notice shall be included in all +;; copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;; SOFTWARE. + ;;; Code: (require 'flymake) diff --git a/checkers/flymake-rest-markdownlint.el b/checkers/flymake-rest-markdownlint.el index 3d79ba3b34..2dff002769 100644 --- a/checkers/flymake-rest-markdownlint.el +++ b/checkers/flymake-rest-markdownlint.el @@ -1,5 +1,25 @@ ;;; flymake-rest-markdownlint.el --- Markdownlint diagnostic function -*- lexical-binding: t -*- +;; Copyright (c) 2021 Mohsin Kaleem + +;; Permission is hereby granted, free of charge, to any person obtaining a copy +;; of this software and associated documentation files (the "Software"), to deal +;; in the Software without restriction, including without limitation the rights +;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +;; copies of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: + +;; The above copyright notice and this permission notice shall be included in all +;; copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;; SOFTWARE. + ;;; Code: (require 'flymake) diff --git a/checkers/flymake-rest-mypy.el b/checkers/flymake-rest-mypy.el index 5976cb7895..77db28558d 100644 --- a/checkers/flymake-rest-mypy.el +++ b/checkers/flymake-rest-mypy.el @@ -1,5 +1,25 @@ ;;; flymake-rest-mypy.el --- MyPy diagnostic function -*- lexical-binding: t -*- +;; Copyright (c) 2021 Mohsin Kaleem + +;; Permission is hereby granted, free of charge, to any person obtaining a copy +;; of this software and associated documentation files (the "Software"), to deal +;; in the Software without restriction, including without limitation the rights +;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +;; copies of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: + +;; The above copyright notice and this permission notice shall be included in all +;; copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;; SOFTWARE. + ;;; Code: (require 'flymake) diff --git a/checkers/flymake-rest-proselint.el b/checkers/flymake-rest-proselint.el index f912b7cec6..db060aa96e 100644 --- a/checkers/flymake-rest-proselint.el +++ b/checkers/flymake-rest-proselint.el @@ -1,5 +1,25 @@ ;;; flymake-rest-proselint.el --- Proselint diagnostic function -*- lexical-binding: t -*- +;; Copyright (c) 2021 Mohsin Kaleem + +;; Permission is hereby granted, free of charge, to any person obtaining a copy +;; of this software and associated documentation files (the "Software"), to deal +;; in the Software without restriction, including without limitation the rights +;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +;; copies of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: + +;; The above copyright notice and this permission notice shall be included in all +;; copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;; SOFTWARE. + ;;; Code: (require 'flymake) diff --git a/checkers/flymake-rest-pycodestyle.el b/checkers/flymake-rest-pycodestyle.el index c2669914de..ce918039cb 100644 --- a/checkers/flymake-rest-pycodestyle.el +++ b/checkers/flymake-rest-pycodestyle.el @@ -1,5 +1,25 @@ ;;; flymake-rest-pycodestyle.el --- Pycodestyle diagnostic function -*- lexical-binding: t -*- +;; Copyright (c) 2021 Mohsin Kaleem + +;; Permission is hereby granted, free of charge, to any person obtaining a copy +;; of this software and associated documentation files (the "Software"), to deal +;; in the Software without restriction, including without limitation the rights +;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +;; copies of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: + +;; The above copyright notice and this permission notice shall be included in all +;; copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;; SOFTWARE. + ;;; Code: (require 'flymake) @@ -21,8 +41,6 @@ :command (list pycodestyle-exec fmqd-temp-file) :error-parser (flymake-rest-parse-rx - ((error bol - (file-name) ":" line ":" column ": " (id (or "E" "W") (one-or-more digit)) " " (message) - eol)))) + ((error bol (file-name) ":" line ":" column ": " (id (or "E" "W") (one-or-more digit)) " " (message) eol)))) (provide 'flymake-rest-pycodestyle) diff --git a/checkers/flymake-rest-pylint.el b/checkers/flymake-rest-pylint.el index bd20c206ce..63e6ce7cba 100644 --- a/checkers/flymake-rest-pylint.el +++ b/checkers/flymake-rest-pylint.el @@ -1,5 +1,25 @@ ;;; flymake-rest-pylint.el --- Pylint diagnostic function -*- lexical-binding: t -*- +;; Copyright (c) 2021 Mohsin Kaleem + +;; Permission is hereby granted, free of charge, to any person obtaining a copy +;; of this software and associated documentation files (the "Software"), to deal +;; in the Software without restriction, including without limitation the rights +;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +;; copies of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: + +;; The above copyright notice and this permission notice shall be included in all +;; copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;; SOFTWARE. + ;;; Code: (require 'flymake) diff --git a/checkers/flymake-rest-rubocop.el b/checkers/flymake-rest-rubocop.el index 233fd32eea..cb3643c42b 100644 --- a/checkers/flymake-rest-rubocop.el +++ b/checkers/flymake-rest-rubocop.el @@ -1,5 +1,25 @@ ;;; flymake-rest-rubocop.el --- Rubocop diagnostic function -*- lexical-binding: t -*- +;; Copyright (c) 2021 Mohsin Kaleem + +;; Permission is hereby granted, free of charge, to any person obtaining a copy +;; of this software and associated documentation files (the "Software"), to deal +;; in the Software without restriction, including without limitation the rights +;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +;; copies of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: + +;; The above copyright notice and this permission notice shall be included in all +;; copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;; SOFTWARE. + ;;; Code: (require 'flymake) diff --git a/checkers/flymake-rest-shellcheck.el b/checkers/flymake-rest-shellcheck.el index e8d0d84ed2..d376d5fa52 100644 --- a/checkers/flymake-rest-shellcheck.el +++ b/checkers/flymake-rest-shellcheck.el @@ -1,5 +1,25 @@ ;;; flymake-rest-shellcheck.el --- Shellcheck diagnostic function -*- lexical-binding: t -*- +;; Copyright (c) 2021 Mohsin Kaleem + +;; Permission is hereby granted, free of charge, to any person obtaining a copy +;; of this software and associated documentation files (the "Software"), to deal +;; in the Software without restriction, including without limitation the rights +;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +;; copies of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: + +;; The above copyright notice and this permission notice shall be included in all +;; copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;; SOFTWARE. + ;;; Code: (require 'flymake) diff --git a/checkers/flymake-rest-yamllint.el b/checkers/flymake-rest-yamllint.el index 7540913867..aa8e1a69d6 100644 --- a/checkers/flymake-rest-yamllint.el +++ b/checkers/flymake-rest-yamllint.el @@ -1,5 +1,25 @@ ;;; flymake-rest-yamllint.el --- Yamllint diagnostic function -*- lexical-binding: t -*- +;; Copyright (c) 2021 Mohsin Kaleem + +;; Permission is hereby granted, free of charge, to any person obtaining a copy +;; of this software and associated documentation files (the "Software"), to deal +;; in the Software without restriction, including without limitation the rights +;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +;; copies of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: + +;; The above copyright notice and this permission notice shall be included in all +;; copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;; SOFTWARE. + ;;; Code: (require 'flymake) diff --git a/flymake-rest-define.el b/flymake-rest-define.el index 158cdeb167..2d5ce81fd7 100644 --- a/flymake-rest-define.el +++ b/flymake-rest-define.el @@ -1,13 +1,32 @@ ;;; flymake-rest-define.el --- A macro to simplify checker creation -*- lexical-binding: t -*- -;;; Commentary: +;; Copyright (c) 2021 Mohsin Kaleem + +;; Permission is hereby granted, free of charge, to any person obtaining a copy +;; of this software and associated documentation files (the "Software"), to deal +;; in the Software without restriction, including without limitation the rights +;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +;; copies of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: + +;; The above copyright notice and this permission notice shall be included in all +;; copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;; SOFTWARE. -;; This file provides a macro, adapted heavily from [[https://github.com/karlotness/flymake-quickdef/blob/150c5839768a3d32f988f9dc08052978a68f2ad7/flymake-quickdef.el][flymake-quickdef]], -;; -;; A shallow fork of [[https://github.com/karlotness/flymake-quickdef][flymake-quickdef]] supporting more flycheck like features. -;; TODO: Finish +;;; Commentary: -;; TODO: license +;; This file provides a macro, adapted heavily from [[https://github.com/karlotness/flymake-quickdef/blob/150c5839768a3d32f988f9dc08052978a68f2ad7/flymake-quickdef.el][flymake-quickdef]], to allow +;; streamlined syntax-checker definitions. The intended purpose is to abstract +;; the process creation, management and cleanup for a checker as much as possible, +;; leaving the developer to only have to specify what command to run and how +;; to parse its output. ;;; Code: @@ -26,7 +45,16 @@ in DEFS is :command and :error-parser. Available Variables -fmqd-source, fmqd-temp-file, fmdq-temp-dir, fmqd-context. TODO: Document. +fmqd-source, fmqd-temp-file, fmdq-temp-dir, fmqd-context. +Within the body of :error-parser and :command, several macro specific variables +are made available. This includes (1) fmqd-source, (2) fmqd-temp-file, +(3) fmqd-temp-dir, (4) fmqd-context. + +1: The source buffer that's being checked by the checker. +2: The path to the temporary file that was created when using :write-type file. +3: The dirname of fmqd-temp-file when using :write-type file. +4: A general purpose list variable that can be used however the developer sees + fit. This is useful for example in `flymake-rest-parse-enumerate'. Body Definitions diff --git a/flymake-rest-hook-use-package.el b/flymake-rest-hook-use-package.el index efdf587f74..f5fcc447a9 100644 --- a/flymake-rest-hook-use-package.el +++ b/flymake-rest-hook-use-package.el @@ -1,5 +1,31 @@ ;;; flymake-rest-use-package.el --- use-package extensions for flymake-rest -*- lexical-binding: t -*- +;; Copyright (c) 2021 Mohsin Kaleem + +;; Permission is hereby granted, free of charge, to any person obtaining a copy +;; of this software and associated documentation files (the "Software"), to deal +;; in the Software without restriction, including without limitation the rights +;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +;; copies of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: + +;; The above copyright notice and this permission notice shall be included in all +;; copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;; SOFTWARE. + +;;; Commentary +;; This file defines a use-package extension for pushing entries onto +;; `flymake-rest-config'. + +;;; Code: + (require 'use-package-core) (defvar flymake-rest-config) ;; In [[file:flymake-rest-hook.el][flymake-rest-hook.el]]. diff --git a/flymake-rest-hook.el b/flymake-rest-hook.el index 477b0324bb..3f282ed6bf 100644 --- a/flymake-rest-hook.el +++ b/flymake-rest-hook.el @@ -1,6 +1,29 @@ ;;; flymake-rest-hook.el --- Support for binding flymake backends to specific modes -*- lexical-binding: t -*- -;; Copyright (C) 2021 Mohsin Kaleem +;; Copyright (c) 2021 Mohsin Kaleem + +;; Permission is hereby granted, free of charge, to any person obtaining a copy +;; of this software and associated documentation files (the "Software"), to deal +;; in the Software without restriction, including without limitation the rights +;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +;; copies of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: + +;; The above copyright notice and this permission notice shall be included in all +;; copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;; SOFTWARE. + +;;; Commentary +;; This file implements a way to associate major-modes to flymake checkers. + +;;; Code: ;;;###autoload (defcustom flymake-rest-config nil @@ -40,9 +63,10 @@ also added to `flymake-diagnostic-functions'." (defun flymake-rest-hook-set-backends () "Function to add all the diagnostic for the current-major mode from `flymake-rest-config' to `flymake-diagnostic-functions'." - (dolist (it flymake-rest-configured-checkers) + (dolist (it (flymake-rest-configured-checkers major-mode)) (add-hook 'flymake-diagnostic-functions (car it) (cdr it) t))) +;;;###autoload (defun flymake-rest-hook-setup () "Setup flymake-hook." (add-hook 'after-change-major-mode-hook #'flymake-rest-hook-set-backends)) diff --git a/flymake-rest-parse-enumerate.el b/flymake-rest-parse-enumerate.el index 642e711c6c..0d4a0dc751 100644 --- a/flymake-rest-parse-enumerate.el +++ b/flymake-rest-parse-enumerate.el @@ -1,11 +1,34 @@ ;;; flymakflymake-backend-parse-enumerate!to simplify checker creation -*- lexical-binding: t -*- +;; Copyright (c) 2021 Mohsin Kaleem + +;; Permission is hereby granted, free of charge, to any person obtaining a copy +;; of this software and associated documentation files (the "Software"), to deal +;; in the Software without restriction, including without limitation the rights +;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +;; copies of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: + +;; The above copyright notice and this permission notice shall be included in all +;; copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;; SOFTWARE. + ;;; Commentary: -;; TODO -;; TODO: license +;; This file defines an error-parser for `flymake-rest-define' which can be used +;; to parse JSON output from the checker into flymake diagnostics. This works by +;; parsing the entire JSON input into a list of diagnostic related data, and then +;; iteratively parsing it into diagnostics. ;;; Code: +;;;###autoload (defmacro flymake-rest-parse-enumerate (gen &rest body) "Error parser for `flymake-backend-define' which parses all of the diagnostics at once using GEN and then preparing them one-at-a-time diff --git a/flymake-rest-parse-rx.el b/flymake-rest-parse-rx.el index ea079cd95b..f2221065d0 100644 --- a/flymake-rest-parse-rx.el +++ b/flymake-rest-parse-rx.el @@ -1,8 +1,35 @@ ;;; flymake-rest-rest.el --- A macro to simplify checker creation -*- lexical-binding: t -*- +;; Copyright (c) 2021 Mohsin Kaleem + +;; Permission is hereby granted, free of charge, to any person obtaining a copy +;; of this software and associated documentation files (the "Software"), to deal +;; in the Software without restriction, including without limitation the rights +;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +;; copies of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: + +;; The above copyright notice and this permission notice shall be included in all +;; copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;; SOFTWARE. + ;;; Commentary: -;; TODO -;; TODO: license +;; This file defines an error-parser for `flymake-rest-define' which can be used +;; to parse plaintext output from the checker into flymake diagnostics. This works +;; by defining some regular expressions (one for each severity level of the checker) +;; and then matching each line of the output to a regular expression. Special +;; capture groups have been setup by the parser that should be used by any calling +;; checkers to ensure the correct fields from the output can be parsed. +;; +;; The approach implemented here was heavily inspired by flychecks :error-parsers +;; feature. ;;; Code: @@ -29,17 +56,32 @@ (end-line . ,(rx (group-n 6 (one-or-more digit)))) (end-column . ,(rx (group-n 7 (one-or-more digit)))))) +;;;###autoload (defmacro flymake-rest-parse-rx (regexps) - "Helper for `flymake-rest-define' which tries to emulate flychecks -:error-parsers. + "`flymake-rest-define' parser using regular expressions. This macro generates a parser that for each line of output from the -checker process, runs one or more REGEXPs on it and then converts the -result to a valid flymake diagnostic (that can be passed back to -`flymake-make-diagnostic'). +checker process, matches one or more regular expressions and then +converts the result to a valid flymake diagnostic that can be +passed back to `flymake-make-diagnostic'. + +REGEXPS should be an alist with the car of each entry being the +severity of the diagnostic it matches (as a symbol that will be +turned into a keyword by this macro) and the cdr should be a +sequence of entries that can be interpreted by the `rx' macro. +To simplify matching specific fields in the parsed output several +helper extensions to `rx' have been defined such as file-name or +line. For a list of these see `flymake-rest-parse-rx-constituents'. +The only required fields that MUST be parsed are the line number +and message. If these are ommited the matched diagnostic will be +skipped. + +WARN: You should not try to capture any extra fields outside of +the special ones described above. This is because any extra capture +groups are used to associate the severity of the diagnostic to the +regexp that matched it (as a performance improvement). -TODO: describe arguments. -" +For an example of this macro in action, see `flymake-rest-pycodestyle'." (unless (> (length regexps) 0) (error "Must supply at least one regexp for error, warning or note")) ;; To avoid having to rematch each diagnostic more than once we append @@ -108,7 +150,7 @@ TODO: describe arguments. (nth severity-ix (quote ,severity-seq)) (concat (when id - (concat (propertize id 'face 'flymake-diag-id!) " ")) + (concat (propertize id 'face 'flymake-rest-diag-id) " ")) message))))))))) res))) diff --git a/flymake-rest.el b/flymake-rest.el index 33f01c2d09..e98dc69668 100644 --- a/flymake-rest.el +++ b/flymake-rest.el @@ -38,10 +38,7 @@ ;; to specify the precedence and preferred order of them and the means ;; to easily configure flymake linting. ;; -;; For more see [[file:README.org][README.org]]. - -;; Please see https://github.com/mohkale/flymake-rest for more -;; information. +;; For more see [[file:README.org][README.org]] or https://github.com/mohkale/flymake-rest. ;;; Code: