All Projects → codingjoe → relint

codingjoe / relint

Licence: MIT license
General purpose RegEx based file linter.

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to relint

therapist
Work out your commitment issues.
Stars: ✭ 29 (-12.12%)
Mutual labels:  lint, linter
li18nt
🌎 Lint your i18n translation files. Detect conflicting properties, duplicates and make it more readable and easier to maintain by formatting it!
Stars: ✭ 29 (-12.12%)
Mutual labels:  lint, linter
test junkie
Highly configurable testing framework for Python
Stars: ✭ 72 (+118.18%)
Mutual labels:  qa, qatools
KaiZen-OpenApi-Parser
High-performance Parser, Validator, and Java Object Model for OpenAPI 3.x
Stars: ✭ 119 (+260.61%)
Mutual labels:  lint, linter
breakcheck
Backwards compatibility linter for Go.
Stars: ✭ 66 (+100%)
Mutual labels:  lint, linter
lint-html-with-css
Lint HTML with CSS. A collection of CSS snippets from the hashtag #lintHTMLwithCSS on twitter. These CSS snippets intend to warn developers about common mistakes made in HTML.
Stars: ✭ 35 (+6.06%)
Mutual labels:  lint, linter
mllint
`mllint` is a command-line utility to evaluate the technical quality of Python Machine Learning (ML) projects by means of static analysis of the project's repository.
Stars: ✭ 67 (+103.03%)
Mutual labels:  lint, linter
flexlint
A flexible linter with rules defined by regular expression
Stars: ✭ 19 (-42.42%)
Mutual labels:  lint, linter
rubocop-linter-action
Rubocop Linter Action: A GitHub Action to run Rubocop against your code!
Stars: ✭ 86 (+160.61%)
Mutual labels:  lint, linter
babel-plugin-transform-react-qa-classes
Add component's name in `data-qa` attributes to React Components
Stars: ✭ 41 (+24.24%)
Mutual labels:  qa, qatools
mailhandler
Simple lightweight mail library which allows you to send and retrieve emails, and get more details about email sending and delivery
Stars: ✭ 49 (+48.48%)
Mutual labels:  qa, qatools
litho-lint-rules
Lint rules for Litho by Facebook http://fblitho.com/
Stars: ✭ 14 (-57.58%)
Mutual labels:  lint, linter
lints
Lint all your JavaScript, CSS, HTML, Markdown and Dockerfiles with a single command
Stars: ✭ 14 (-57.58%)
Mutual labels:  lint, linter
npm-groovy-lint
Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files using command line
Stars: ✭ 124 (+275.76%)
Mutual labels:  lint, linter
actionlint
Static checker for GitHub Actions workflow files
Stars: ✭ 1,385 (+4096.97%)
Mutual labels:  lint, linter
eslint-plugin-roku
ESLint plugin to parse and lint BrightScript files
Stars: ✭ 44 (+33.33%)
Mutual labels:  lint, linter
nano-staged
Tiny tool to run commands for modified, staged, and committed files in a GIT repository.
Stars: ✭ 347 (+951.52%)
Mutual labels:  lint, linter
autotests
Armbian automated testings
Stars: ✭ 18 (-45.45%)
Mutual labels:  qa, qatools
makefiles
No description or website provided.
Stars: ✭ 23 (-30.3%)
Mutual labels:  lint, linter
php-qa-tools
A metapackage for all PHP quality assurance tools we use at Dealerdirect
Stars: ✭ 36 (+9.09%)
Mutual labels:  qa, qatools

ReLint

Regular Expression Linter

Write your own linting rules using regular expressions.

Installation

pip install relint

Usage

You can write your own regular rules in a YAML file, like so:

- name: No ToDo
  pattern: '(?i)todo' # case insensitive flag
  hint: Get it done right away!
  filePattern: .*\.(py|js)
  error: false

The name attribute is the name of your linter, the pattern can be any regular expression. The linter does lint entire files, therefore your expressions can match multiple lines and include newlines.

You can narrow down the file types your linter should be working with, by providing the optional filePattern attribute. The default is .*.

The optional error attribute allows you to only show a warning but not exit with a bad (non-zero) exit code. The default is true.

The following command will lint all files in the current directory:

relint -c .relint.yml **

The default configuration file name is .relint.yml within your working directory, but you can provide any YAML or JSON file.

If you prefer linting changed files (cached on git) you can use the option --diff [-d]:

git diff | relint my_file.py --diff

This option is useful for pre-commit purposes. Here an example of how to use it with pre-commit framework:

- repo: https://github.com/codingjoe/relint
  rev: 1.2.0
  hooks:
    - id: relint

You can find an example of relint-pre-commit.sh in this repository.

Samples

- name: db fixtures
  pattern: 'def test_[^(]+\([^)]*(customer|product)(, |\))'
  hint: Use model_bakery recipies instead of db fixtures.
  filePattern: test_.*\.py

- name: model_bakery recipies
  pattern: baker\.make\(
  hint: Please use baker.make_recipe instead of baker.make.
  filePattern: (test_.*|conftest)\.py

- name: the database is lava
  pattern: '@pytest.fixture.*\n[ ]*def [^(]+\([^)]*(db|transactional_db)(, |\))'
  hint: Please do not create db fixtures but model_bakery recipies instead.
  filePattern: .*\.py

- name: No logger in management commands
  pattern: (logger|import logging)
  hint: Please write to self.stdout or self.stderr in favor of using a logger.
  filePattern: \/management\/commands\/.*\.py
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].