Git Product home page Git Product logo

wip-lintfree's People

Contributors

dependabot[bot] avatar mend-bolt-for-github[bot] avatar nomicode avatar renovate-bot avatar

Watchers

 avatar

Forkers

lgtm-migrator

wip-lintfree's Issues

Add support for convention commits linting

Create new `run` command

The run command should read config files from a separate directory and should allow the user to wrap other tools and pre-process their output (especially satisfying the use-case of enriching the output by adding line number information). This would help with some tools (like Prettier, Black, and Lychee) which fall into two categories:

  • They either reformat the code and present success or fail status (in which case, line number information can be gleaned by comparing the before and after results)
  • They produce per-file errors but provide no line number information (in which case, line number information can be gleaned by grepping the file for strings that match the error output)

In fact, it seems to me that these two categories could be generalized so that a single built-in feature could be configured to handle most use-cases.

The run command could also take care of other common tasks:

  • Identifying a list of files or directories to search (based on file patterns, media types, or more advanced methods, such as inspecting the first line of the file for a specific directive)
  • Passing the list of files to the tool in question (either as a list of arguments, or, perhaps preferably, running the tool in parallel, one file at a time)

Add an `obelist run` subcommand

This issue was inspired by:

At the moment, the way I a using Obelist is as follows:

  • Create a parser configuration like .obelist/ec.yaml
  • Create a script like test/lint/ec.sh, which is responsible for selecting which files to lint, then runs ec on each file and pipes the results into the obelist command
  • Add rules to the Makefile to wrap the lint script

This situation is even more complex for tools like Prettier, which requires me to wrap the tool, produce diffs, and generate line-based annotations before piping to the obelist command.

I don't want to set up all this machinery on every project. It would be much easier if Obelist could automate all of this for me.

My current thinking is:

  • Extend the configuration files so that you can specify:

    • Which files to lint
    • What command to use to lint them
    • How to parse the results

    The configuration could include information about how to wrap the results (e.g., for commands that only produce diffs).

  • Create a new subcommand: obelist run that takes the name of a single lint check and is capable of running the lint commands and parsing the output in one step (avoiding the need to write a separate shell script to wrap the lint command)

  • Add a central .obelist.yaml file, allowing you to configure a default set of lint checks (avoiding the need to integrate multiple lint checks into a separate build system such as GNU Make)

Package complimentary scripts

turn the scripts I'm making to wrap other tools into a shippable package

perhaps made as plugins with octonote as an extendable package

or perhaps as a seperate package that can wrap tools and produce standard output

same is true for standardized scripts that run all lint tools

Rename project

I would like a project name that is:

  • Less tied to GitHub specifically (perhaps this project could be useful for other Git platforms)
  • Perhaps is a bit less focused on the "note" aspect and incorporate the wrapping of lint tools to produce more useful action as well as the wrapping of lint tools for the purpose of output through the tool

Plus there are a few other projects on GitHub already with this name

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency prospector to v1.10.3
  • fix(deps): update dependency urlextract to v1.9.0
  • chore(deps): update actions/checkout action to v4
  • chore(deps): update dependency flake8 to v7
  • fix(deps): update dependency lxml to v5
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/build.yaml
  • actions/checkout v3
pep621
pyproject.toml
  • poetry-core >=1.0.0
poetry
pyproject.toml
  • python ^3.7
  • pastel ^0.2.1
  • click ^8.0.3
  • sh ^1.14.2
  • inflection ^0.5.1
  • wrapt ^1.13.3
  • charset-normalizer ^2.0.7
  • lxml ^4.6.4
  • pyjq ^2.5.2
  • PyYAML ^6.0
  • natsort ^8.0.0
  • urlextract ^1.4.0
  • ipython ^7.31.1
  • icecream ^2.1.1
  • reorder-python-imports ^3.0.0
  • prospector ^1.5.3
  • pyroma ^4.0
  • vulture ^2.3
  • flake8 ^3.9.2
  • flake8-cognitive-complexity ^0.1.0
  • pep8 ^1.7.1

  • Check this box to trigger a request for Renovate to run again on this repository

Wrap `diff` functionality into Obelist

At the moment, I can generate line-based annotations from tools that produce diff-based output. This approach is clumsy, and I don't want to re-implement this multiple times in multiple repositories.

Problems:

  • Some tools will only modify files in place. These tools need to be wrapped so that a temporary copy of the file is created, modified, and then compared to the original. Other tools can print diffs without modifying the files. Both types of tools need to be accommodated.

  • Some tools can only be used on one file at a time. Other tools can be run on multiple files at once. Both types of tools need to be accommodated.

Possible approaches:

  • A new subcommand that genericizes the job of a wrapper script (i.e., handles copying files, producing diffs, and so on) and can be used with any third-party tool.

  • A new diff parser that reads in a diff (or diffs) and produces a set of line-based annotations.

  • Extend the parser configuration for tools like this so that you can specify the command to run, how the diffs should be generated, and so on. Then, instead of running the lint command with a wrapper and passing the results to obelist parse. You could do something like obelist run and have the end-to-end process handled for you.

EditoConfig produces an error if run on a binary file

I accidentally left a binary file in the source repository and while running a lint check, the EditorConfig check produced a Python error when trying to process the output.

To solve this problem, I filtered out binary files from the EditorConfig checks. However, the underlying issue should be replicated and investigated.

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.