Giter Site home page Giter Site logo

gramma's Introduction

Hi there πŸ‘‹

gramma's People

Contributors

azu avatar caderek avatar devorbitus avatar devsilv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gramma's Issues

Ignore Specific Instances of a Finding

Is your feature request related to a problem? Please describe.
I'd like to be able to instruct gramma to ignore a specific finding. I'm using Markdown with Pandoc and have some control sequences like \newpage which gets picked up as an issue by gramma/LanguageTool. These cases make using gramma difficult because on each run I have to tell it to ignore each and every one every time, or separate out files with these types of sequences.

Describe the solution you'd like
I'd like to be able to instruct gramma to ignore specific findings by line (similar to most linters). I can see a few ways of accomplishing this.

The first would be to append a Markdown comment to the end of a line to instruct gramma to throw away the finding from the LanguageTool server:

\newpage <!-- gramma:ignore -->

Another method could be to surround a block of text to control whether or not gramma returns findings, similar to Python's Black formatter.

<!-- gramma:off -->
\newpage
<!-- gramma:on -->

Not sure how this would be accomplished outside of Markdown as the concept of a comment may not work everywhere else this is used.

For my specific case, perhaps a flag for LaTeX could be implemented (--latex); similar to the --markdown flag to remove these false positives.

Could also take an approach similar to the VSCode LanguageTool extension and save a database of manually marked false positives as I've done for this case:

{"rule":"MORFOLOGIK_RULE_EN_US","sentence":"^\\Q\\newpage\\E$"}

Describe alternatives you've considered
I can't think of any alternatives.

ERR_INVALID_ARG_TYPE when trying to add to local dictionary

Describe the bug

When running gramma against a markdown file using en-GB language, a new word is found.
Attempting to add it to the dictionary causes an npm error.
New files can be created in users home directory and in current working directory.

To Reproduce

gramma check -m -l "en-GB" Lessons.md
Language: English (GB)
Resolved: 0 | Pending: 12
---------------------------------

Rule: typos
Explanation: Possible spelling mistake found.

Context: # Lessons  1. [What is iRODS?](https://github.com/metadata-school/In...
Suggested fix: 1) rods  2) irons  3) iPods  4) prods

---------------------------------
? What do you want to do?
Enter: default (1)
1-4: choose fix
0: custom fix
i: ignore
l: add to local dictionary
g: add to global dictionary
n: next
 β€Ί l
node:internal/errors:464
    ErrorCaptureStackTrace(err);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined
    at Object.openSync (node:fs:577:10)
    at Object.openSync (pkg/prelude/bootstrap.js:739:32)
    at Object.writeFileSync (node:fs:2153:35)
    at configure (/snapshot/gramma/src/actions/configure.js:87:6)
    at checkInteractively (/snapshot/gramma/src/actions/checkInteractively.js:50:7)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async check (/snapshot/gramma/src/commands/check.js:32:31) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Expected behavior

New word is added to the local dictionary.

Desktop (please complete the following information):

  • OS: Ubuntu 20.04 LTS run in WSL.
  • Gramma Version: 1.6.0

Pressing the ESCAPE key in the "check mode" causes the application to terminate with an exception

Steps to reproduce

  1. Run the application with the following command:

    gramma check "."
    
  2. Press the ESCAPE key.

Actual behavior

The application terminates, and the output contains a stack trace, starting with the following:

(node:12393) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'value' of undefined
...

Expected behavior

I do not know whether all the described behavior or only part of it is a bug. The README does not contain information about possible behavior of any key. Possibilities of expected behavior are:

  • If all of the behavior is a bug – the ESCAPE key should not cause the application to terminate – then the expected behavior is both not to terminate, and to print some appropriate message (e.g. This key is not handled) or to print nothing at all.
  • If only part of the behavior is a bug – the ESCAPE key should terminate the application, but there should be no stack trace printed – then the expected behavior is just to print some appropriate message (e.g. This key is not handled) or to print nothing at all.

Notes

As I have observed, this behavior happen not only using gramma check, but I have not checked all the possible cases, so I leave for the author finding the scope of this behavior.


UPDATE: This problem happens also with the combination CTRL+D. But, since I cannot currently make the application work, I cannot confirm whether the stack trace is the same. I will try that later.

Is the project alive?

How can I help you?

I would like to know if there is any plan to maintain the project or not.

The output of the command "gramma check" with no argument contains a stack trace

Steps to reproduce

  1. Run the application with the following command:
gramma check
  1. The output contains a stack trace, starting with the following:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be one of type string, Buffer, or URL. Received type undefined
...

Suggestion

I do not consider this as a bug or an invalid behavior (it may be indeed the expected behavior). But in general, I think that there is no point to print such an information to a non-developer.

Instead, there might be added a flag -d/--debug which would enable all commands to print stack traces in case of a failure particular failures.

PORT support on `gramma server start`

Is your feature request related to a problem? Please describe.

Currently, port number is hardcoded 8081.

const PORT = await portfinder.getPortPromise({
port: 8081,
})

Describe the solution you'd like
I want to use another port number like following.

gramma server start --port 12345

Describe alternatives you've considered

PORT=12345 gramma server start

Additional context

πŸ“ Current gramma server start does not show the port number of languagetools server.
if the port number is conflicted, the user can not know the local server url.

$ gramma server start
Starting local API server...
Waiting for local API server...
Waiting for local API server...
API server started! PID: 55069

command-line option to summarize number and type of errors

I am interested in summarizing errors from texts in a simple way and not in identifying or implementing fixes. I don't see an option for this, but I am wondering if there is a way to output a single summary line with number of potential mistakes (total) and number of different error classes. Thanks for considering this!

There are links for getting specific versions of the application in the section "Installation" of the README

In the section "Installation", there are put links for getting specific versions of the application. In general, this is not a bug; but these links are already outdated, and I am worrying that they will remain so. If they will, this may be confusing for the reader, and shall be considered a bug.

Actual behavior

The section "Instalation" of the README contains links for getting specific versions of the application.

Expected behavior

The section "Instalation" of the README does not contain links for getting specific versions of the application. Instead, there may be put information about getting new versions of the application from the page with releases.

Unable to check files

Describe the bug
When I gramma check a file, it waits for a second and then stops, with no output.

To Reproduce
Try to gramma check a file

Expected behavior
The gramma checking UI appearing.

Screenshots
image

Desktop (please complete the following information):

  • OS: Ubuntu Server 22.04
  • Installed through binary

Additional context
This was tested on a web server via SSH. gramma listen still works with its UI. A workaround I found was running gramma listen "`cat mistake.txt`", but you still need to copy the printed changes to the file after going through the wizard.

Is Proxy Supported?

How can I help you?
As title, I'm working behind a proxy and my working-well proxy doesn't seem to be taken by gramma, so doe it mean that it's not supported yet?

Environment: Linux Mint
Proxy Variables: http_proxy, https_proxy.

By the way the SW does looks awsome and with great potential right there. Thanks for your brilliant work ! @caderek

Make a AUR package

Is your feature request related to a problem? Please describe.
I have a script to setup my Arch Linux install, to install this via the script I would need to figure out how the script works then add npm support.

Describe the solution you'd like
A AUR package that let's me more easily install gramma.

Describe alternatives you've considered
Official Arch package or a 3rd party repo might be harder to do however.

German config languages throw error

Describe the bug
Using any of the German Languages throws an error:

Details: invalid json response body at http://api.grammarbot.io/v2/check reason: Unexpected token E in JSON at position 0

To Reproduce
Using any of the following languages will throw the error: de de-De de-At de-CH
gramma config language de-DE

Expected behavior
To not throw an error

Desktop (please complete the following information):

  • OS: MacOS

gramma server install fails

Describe the bug
command 'npx gramma server install' fails:

res.body.pipe(str).pipe(fileStream)
             ^
TypeError: res.body.pipe is not a function

To Reproduce
install gramma with node 18.16.0 & npm 9.5.1

Expected behavior
It should download the file

Screenshots
Capture d’écran 2023-05-29 aΜ€ 23 33 27

Desktop (please complete the following information):

  • OS: macOS
  • node 18.16.0

Additional context
Seems to work if I replace this slice of code in downloadFile.js (L30):

return new Promise((resolve, reject) => {
  res.body.pipe(str).pipe(fileStream)
  res.body.on("error", (err) => {
    reject(err)
  })
 fileStream.on("finish", () => {
   bar.stop()
   resolve()
 })
})

by

await pipeline(res.body, str, fileStream)
bar.stop()

with const { pipeline } = require('node:stream/promises');

The command "gramma listen" recognizes a space in the string while there is none

Steps to reproduce

  1. Run the application with the following command:
gramma listen "."
  1. The output is contains the following:
Explanation: Don't put a space before the full stop

Actual behavior

The application recognizes a space.

Expected behavior

The application does not recognize a space. Instead, for example, the explanation might mention starting the sentence from a dot.

The website https://caderek.github.io/gramma/ is not mentioned neither in the README nor in the project

This project has a separate official website: https://caderek.github.io/gramma/. But, I did not find it in the README or anywhere else in the project here (on GitHub). If I am right, then a user that encounters this project here probably has no chance to find its website.

Actual behavior

The website https://caderek.github.io/gramma/ is not mentioned in the README or anywhere else in this project on GitHub.

Expected behavior

The website https://caderek.github.io/gramma/ is mentioned in the README and/or in the field "Website" on the tab "Code" (next to the project title).

The behavior of running the application without arguments is not described in the documentation

After running the application without arguments, there appeared a blank line. The application seemed to not do anything. After pressing ENTER again, there appeared the following string in a new line:

No mistakes found!

After that, there appeared the command prompt, which may mean that the application terminates (I cannot be sure).

This behavior is not described in the documentation, and – for me – seems to be counterintuitive.

Actual behavior

The documentation has no description about what happening and/or what is going to happen when run in the console without arguments.

Expected behavior

The documentation contains the following information described:

  • is it expected that the application be run without arguments;
  • what shall happen when running it without arguments.

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.