Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Add debug command #725

Merged
merged 1 commit into from
Oct 6, 2016
Merged

Add debug command #725

merged 1 commit into from
Oct 6, 2016

Conversation

IanVS
Copy link
Member

@IanVS IanVS commented Oct 6, 2016

This PR adds a Linter Eslint: Debug command which will pop open a notification with some useful debugging information including various package versions, the type of ESLint is being used for the current file, the linter-eslint configuration, time since the last atom restart, and more.

My intent is to add an issue template which asks users to provide the output of this command, to assist package maintainers in troubleshooting and triaging incoming issue reports.

Example output:

image

const linterEslintMeta = require(Path.join(atom.packages.resolvePackagePath('linter-eslint'), 'package.json'))
const config = atom.config.get('linter-eslint')
const configString = JSON.stringify(config, null, 2)
const hoursSinceRestart = process.uptime() / 3600
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want hours or minutes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think tenths of hours (6 min resolution, which is what it is showing now) is enough to tell us whether it's been restarted recently, without being ridiculous when it hasn't been restarted in days. But, happy to change it if you think minutes would be better.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, completely forgot to see how that looked in the output. This is just fine for me.

} catch (e) {
if (config.useGlobalEslint && e.code === 'ENOENT') {
throw new Error(
'ESLint not found, Please install or make sure Atom is getting $PATH correctly'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well fix #680 here, maybe something along the lines of "Global ESLint not found, please ensure npm get prefix returns correctly or set the path in settings"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah happy to change if you like, or I can submit another PR right after this one, since it's kind of a different issue.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's probably a better idea, just saw that what was reporting the initial message is further down in the code here anyway.

@IanVS IanVS merged commit 2310e86 into master Oct 6, 2016
@IanVS IanVS deleted the add-debug-command branch October 6, 2016 17:23
@Arcanemagus
Copy link
Member

Reverting this so we can get #609 merged.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants