{"id":27022080,"url":"https://github.com/james-d-mitchell/gaplint","last_synced_at":"2025-04-04T19:55:39.718Z","repository":{"id":18969871,"uuid":"85508724","full_name":"james-d-mitchell/gaplint","owner":"james-d-mitchell","description":"A linter for GAP (https://www.gap-system.org/)","archived":false,"fork":false,"pushed_at":"2025-01-30T12:45:46.000Z","size":1173,"stargazers_count":7,"open_issues_count":3,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-03T12:15:36.700Z","etag":null,"topics":["lint","lint-checking","linters","syntax-checker","syntax-checking"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/james-d-mitchell.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-19T21:06:50.000Z","updated_at":"2025-01-30T12:44:49.000Z","dependencies_parsed_at":"2024-05-02T09:38:01.696Z","dependency_job_id":"649fa1eb-e8af-4a12-82f1-a0d2e8ed22d8","html_url":"https://github.com/james-d-mitchell/gaplint","commit_stats":{"total_commits":73,"total_committers":7,"mean_commits":"10.428571428571429","dds":0.589041095890411,"last_synced_commit":"9596d26a555c0967b7f8e0fef9a0d539eae9e5eb"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/james-d-mitchell%2Fgaplint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/james-d-mitchell%2Fgaplint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/james-d-mitchell%2Fgaplint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/james-d-mitchell%2Fgaplint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/james-d-mitchell","download_url":"https://codeload.github.com/james-d-mitchell/gaplint/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247185747,"owners_count":20898025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lint","lint-checking","linters","syntax-checker","syntax-checking"],"created_at":"2025-04-04T19:55:39.131Z","updated_at":"2025-04-04T19:55:39.711Z","avatar_url":"https://github.com/james-d-mitchell.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. image:: logo/logo.png\n  :width: 256\n  :alt: The gaplint logo, an image of a piece of lint with the word \"GAP\"\n   written above it and \"lint\" within it.\n\n**************************************************************************\nREADME - gaplint - by Reinis Cirpons, James D. Mitchell, and Simon Tollman\n**************************************************************************\n\n``gaplint`` automatically checks the format of a GAP file according to\nsome conventions, which are somewhat configurable. It prints the nature\nand location of instances of any instances of violations of these\nconventions (see below for more details).\n\nInstallation\n============\n\nSimply run::\n\n    $ pip install gaplint\n\nUsage\n=====\n\nTo use it::\n\n    $ gaplint --help\n\nList of all rules\n=================\n\nTo disable all rules for a particular file you can add the line::\n\n    # gaplint: disable = all\n\nto the start of the file before any lines that contain any code. All\nrules are enabled by default.\n\nA table of all currently implemented rules is given below:\n\n.. list-table:: gaplint rules\n   :widths: 6 40 40\n   :header-rows: 1\n\n   * - Code\n     - Name\n     - Description\n   * - W000\n     - analyse-lvars\n     - Warns if there are declared local variables that are not used or\n       assigned but not used.\n   * - W001\n     - consecutive-empty-lines\n     - Warns if there are consecutive empty lines.\n   * - W002\n     - line-too-long\n     - Warns if there is a line which is longer than the configured maximum\n       (defaults to ``80``).\n   * - W003\n     - indentation\n     - Warns if a line is under indented.\n   * - W004\n     - align-assignments\n     - Warns if there are assignments in consecutive lines that are not\n       aligned.\n   * - W005\n     - align-trailing-comments\n     - Warns if there are trailing comments in consecutive lines that are not\n       aligned.\n   * - W006\n     - align-comments\n     - Warns if there are non-trailing comments in consecutive lines that are\n       not aligned.\n   * - W007\n     - trailing-whitespace\n     - Warns if there is trailing whitespace at the end of a line.\n   * - W008\n     - no-space-after-comment\n     - Warns if there is no space after any number of # is a line.\n   * - W009\n     - not-enough-space-before-comment\n     - Warns if there is not enough space before the first # in any line\n       (defaults to ``2``).\n   * - W010\n     - space-after-comma\n     - Warns if a comma is followed by more than ``1`` space.\n   * - W011\n     - space-before-comma\n     - Warns if a comma is preceded by a space.\n   * - W012\n     - space-after-bracket\n     - Warns if there is a space after an opening bracket.\n   * - W013\n     - space-before-bracket\n     - Warns if there is a space before a closing bracket.\n   * - W014\n     - multiple-semicolons\n     - Warns if there is more than one semicolon in a line.\n   * - W015\n     - keyword-function\n     - Warns if the keyword ``function`` is not followed by an open bracket.\n   * - W016\n     - whitespace-op-assign\n     - Warns if there is not exactly 1 space after an assignment  (``:=``).\n   * - W017\n     - tabs\n     - Warns if there are tabs.\n   * - W018\n     - function-local-same-line\n     - Warns if the keywords ``function`` and ``local`` appear in the same\n       line.\n   * - W019\n     - whitespace-op-minus\n     - Warns if there is not exactly 1 space either side of a minus (``-``)\n       operator\n   * - W020\n     - whitespace-op-plus\n     - Warns if there is not exactly 1 space either side of a plus (``+``)\n       operator.\n   * - W021\n     - whitespace-op-multiply\n     - Warns if there is not exactly 1 space either side of a multiply (``*``)\n       operator.\n   * - W022\n     - whitespace-op-negative\n     - Warns if there is not exactly 1 space preceding a negative (``-``)\n       operator.\n   * - W023\n     - whitespace-op-less-than\n     - Warns if there is not exactly 1 space either side of a less-than (``\u003c``)\n       operator.\n   * - W024\n     - whitespace-op-less-equal\n     - Warns if there is not exactly 1 space either side of a less-than or\n       equal-to (``\u003c=``) operator.\n   * - W025\n     - whitespace-op-more-than\n     - Warns if there is not exactly 1 space either side of a greater-than\n       (``\u003e``) operator.\n   * - W026\n     - whitespace-op-more-equal\n     - Warns if there is not exactly 1 space either side of a greater than or\n       equal to (``\u003e=``) operator.\n   * - W027\n     - whitespace-op-equals\n     - Warns if there is not exactly 1 space either side of an equals (``=``)\n       operator.\n   * - W028\n     - whitespace-op-lambda\n     - Warns if there is not exactly 1 space either side of the mapping\n       (``-\u003e``) operator in a lambda function.\n   * - W029\n     - whitespace-op-divide\n     - Warns if there is not exactly 1 space either side of a division (``/``)\n       operator.\n   * - W030\n     - whitespace-op-power\n     - Warns if there is not exactly 1 space either side of a power (``^``)\n       operator.\n   * - W031\n     - whitespace-op-not-equal\n     - Warns if there is not exactly 1 space either side of a not-equal\n       (``\u003c\u003e``) operator.\n   * - W032\n     - whitespace-double-dot\n     - Warns if there is not exactly 1 space either side of an arithmetic\n       progression (``..``) operator.\n   * - W033\n     - assign-then-return\n     - Warns if a variable is pointlessly assigned and then immediately\n       returned.\n   * - W034\n     - 1-line-function\n     - Warns that a one line function could be a lambda.\n   * - W035\n     - pointless-lambda\n     - Warns when there are lambda functions of the form ``x -\u003e f(x)`` which\n       can be replaced by ``f``.\n   * - W036\n     - use-return-true\n     - Warns that ``x -\u003e true`` can be replaced by ``ReturnTrue``.\n   * - W037\n     - use-return-false\n     - Warns that ``x -\u003e false`` can be replaced by ``ReturnFalse``.\n   * - W038\n     - use-return-fail\n     - Warns that ``x -\u003e fail`` can be replaced by ``ReturnFail``.\n   * - W039\n     - use-return-first\n     - Warns to replace lambdas of the form ``{x, y, z, ...} -\u003e x`` by\n       ``ReturnFirst``.\n   * - W040\n     - use-id-func\n     - Warns that ``function(x) return x; end;`` can be replaced by ``IdFunc``.\n   * - W041\n     - no-semicolon-after-function\n     - Warns if there's an unnecessary semicolon in ``function(.*);``.\n   * - W042\n     - use-not-eq\n     - Warns to use ``x \u003c\u003e y`` instead of ``not x = y``.\n   * - W043\n     - dont-use-arg\n     - Warns to use ``function(arg...)`` instead of ``function(arg)``.\n   * - W044\n     - if-then-return-true-else-return-false\n     - Warns that ``if XYZ then return true; else return false; fi;`` by\n       ``return XYZ;``\n   * - W045\n     - if-then-return-false-else-return-true\n     - Warns that ``if XYZ then return false; else return true; fi;`` by\n       ``return not XYZ;``\n   * - W046\n     - unused-func-args\n     - Warns if there are unused function parameters (use ``_`` to suppress).\n   * - W047\n     - duplicate-function\n     - Warns if there is a duplicate function.\n   * - W048\n     - use-remove-not-unbind\n     - Warns that ``Unbind(x[Length])`` can be replaced by ``Remove(x)``.\n\nYou can obtain an explanation of a rule at the command line using the\n``--explain`` flag, i.e. ``--explain W000,W001``.  Passing in ``--explain all``\nwill produce a table of all rules.\n\nConfiguration\n=============\n\nCertain parameters can be configured, for example, the maximum number of\ncharacters permitted per line. All rules are enabled by default but can\nbe disable at the command line, by comments in the file itself, or in a\nconfiguration file ``.gaplint.yml``.\n\n**Configuration keywords:**\n\n- ``columns``: maximum number of characters per line. *Defaults to 80*.\n- ``disable``: rules can be disabled using their name or code.\n  *Defaults to no rules disabled*.\n- ``dupl-func-min-len``: only warn about duplicate functions with at least\n  this many lines. *Defaults to 4*.\n- ``enable``: rules can be enabled using their name or code. *Defaults to all rules enabled*.\n- ``indentation``: minimum indentation of nested statements. *Defaults\n  to 2*.\n- ``max-warnings``: maximum number of warnings before ``gaplint``\n  aborts. *Defaults to 1000*.\n\nA list of all of the rules that ``gaplint`` can apply is given below.\n\nYou can alter the configuration in various places, the order of\nprecedence of these is governed by the hierarchy described below. A\npreference given somewhere higher in the hierarchy will be\ngiven precedence. \n\nConfiguration\n=============\n\nVia the command line\n^^^^^^^^^^^^^^^^^^^^\n\nThese preferences will be applied for a single run of ``gaplint`` only (though\nmultiple files may be linted in this run). To configure ``gaplint`` to be run\non ``file1``, ``file2``, ..., with preferences as in the example above, we\nenter the following into the command line::\n\n       gaplint --columns=100 --indentation=4 --disable=W002,W028 file1 file2 ...\n\nVia comments in source files\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nAny rule, including ``all``, can be suppressed for a specific line or for a\nwhole file:\n\n* To supress a rule(s) for a given line, include the following after the line\n  of code for which the rule is to be suppressed::\n\n   # gaplint: disable=\u003cname_or_code\u003e, \u003cname_or_code\u003e ...\n\n*  If the above is too long to fit after the relevant line of code,\n   suppressions can be declared in the line above for the line below\n   by including ``(nextline)``::\n\n   # gaplint: disable(nextline)=\u003cname_or_code\u003e, \u003cname_or_code\u003e, ...\n\n*  If rules have been suppressed for a given line using both the\n   in-line and *nextline* options, the union of the two rule sets\n   given for suppression will be disabled for the line.\n\n*  To suppress rules for a whole file the following must be included\n   before any code is written (i.e. either as the first line of a GAP\n   file, or preceded by any combination of only whitespace, empty\n   lines and comments)::\n\n   # gaplint: disable=\u003cname_or_code\u003e, \u003cname_or_code\u003e, ...\n\nVia a configuration file\n^^^^^^^^^^^^^^^^^^^^^^^^\n\n   To configure ``gaplint`` as in the above examples, create a\n   ``.gaplint.yml`` file containing the following lines:\n\n   .. code:: yaml\n\n       columns: 100\n       indentation: 4\n       disable:\n       - W002\n       - W028\n\n``gaplint`` looks for the ``.gaplint.yml`` file in the current\ndirectory, and its ancestors, until it reaches a directory containing\na ``git`` repository or the ``.gaplint.yml`` file is located. If\nthere is no ``.gaplint.yml`` file, then the default configuration\noptions are used. The options configured in ``.gaplint.yml`` are\napplied to every file on which ``gaplint`` is run from the current\ndirectory unless overruled higher in the hierarchy.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjames-d-mitchell%2Fgaplint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjames-d-mitchell%2Fgaplint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjames-d-mitchell%2Fgaplint/lists"}